Impl UseSpecializedDecodable for &T

This commit is contained in:
John Kåre Alsaker 2019-03-30 01:53:11 +01:00
parent e835d27ad3
commit 4ccb9ae98a
2 changed files with 1 additions and 9 deletions

View file

@ -24,18 +24,9 @@ macro_rules! declare_arena {
}
}
macro_rules! impl_specialized_decodable {
([decode] $ty:ty, $tcx:lifetime) => {
impl<$tcx> serialize::UseSpecializedDecodable for &$tcx $ty {}
};
([] $ty:ty, $tcx:lifetime) => {};
}
macro_rules! impl_arena_allocatable {
([], [$($a:tt $name:ident: $ty:ty,)*], $tcx:lifetime) => {
$(
impl_specialized_decodable!($a $ty, $tcx);
impl ArenaAllocatable for $ty {}
impl<$tcx> ArenaField<$tcx> for $ty {
#[inline]

View file

@ -911,4 +911,5 @@ impl<T: UseSpecializedDecodable> Decodable for T {
impl<'a, T: ?Sized + Encodable> UseSpecializedEncodable for &'a T {}
impl<T: ?Sized + Encodable> UseSpecializedEncodable for Box<T> {}
impl<T: Decodable> UseSpecializedDecodable for Box<T> {}
impl<'a, T: ?Sized + Decodable> UseSpecializedDecodable for &'a T {}
impl<'a, T: ?Sized + Decodable> UseSpecializedDecodable for &'a [T] {}