]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/ty/codec.rs
Rollup merge of #61715 - RalfJung:test-ascii-lowercase, r=varkor
[rust.git] / src / librustc / ty / codec.rs
index 038cd9812e75c8b7e9aba12c33a4cb29e50ee839..a76cc3dfdec02a1686729d652d79cfc2f835b93e 100644 (file)
@@ -132,7 +132,7 @@ fn positioned_at_shorthand(&self) -> bool {
 }
 
 #[inline]
-pub fn decode_arena_allocable<'a, 'tcx, D, T: ArenaAllocatable<'tcx> + Decodable>(
+pub fn decode_arena_allocable<'a, 'tcx, D, T: ArenaAllocatable + Decodable>(
     decoder: &mut D
 ) -> Result<&'tcx T, D::Error>
     where D: TyDecoder<'a, 'tcx>,
@@ -142,7 +142,7 @@ pub fn decode_arena_allocable<'a, 'tcx, D, T: ArenaAllocatable<'tcx> + Decodable
 }
 
 #[inline]
-pub fn decode_arena_allocable_slice<'a, 'tcx, D, T: ArenaAllocatable<'tcx> + Decodable>(
+pub fn decode_arena_allocable_slice<'a, 'tcx, D, T: ArenaAllocatable + Decodable>(
     decoder: &mut D
 ) -> Result<&'tcx [T], D::Error>
     where D: TyDecoder<'a, 'tcx>,
@@ -296,7 +296,9 @@ macro_rules! __impl_decoder_methods {
 
 #[macro_export]
 macro_rules! impl_arena_allocatable_decoder {
-    ([$DecoderName:ident [$($typaram:tt),*]], [[decode] $name:ident: $ty:ty], $tcx:lifetime) => {
+    ([]$args:tt) => {};
+    ([decode $(, $attrs:ident)*]
+     [[$DecoderName:ident [$($typaram:tt),*]], [$name:ident: $ty:ty], $tcx:lifetime]) => {
         impl<$($typaram),*> SpecializedDecoder<&$tcx $ty> for $DecoderName<$($typaram),*> {
             #[inline]
             fn specialized_decode(&mut self) -> Result<&$tcx $ty, Self::Error> {
@@ -311,14 +313,16 @@ fn specialized_decode(&mut self) -> Result<&$tcx [$ty], Self::Error> {
             }
         }
     };
-    ([$DecoderName:ident [$($typaram:tt),*]], [[] $name:ident: $ty:ty], $tcx:lifetime) => {};
+    ([$ignore:ident $(, $attrs:ident)*]$args:tt) => {
+        impl_arena_allocatable_decoder!([$($attrs),*]$args);
+    };
 }
 
 #[macro_export]
 macro_rules! impl_arena_allocatable_decoders {
     ($args:tt, [$($a:tt $name:ident: $ty:ty,)*], $tcx:lifetime) => {
         $(
-            impl_arena_allocatable_decoder!($args, [$a $name: $ty], $tcx);
+            impl_arena_allocatable_decoder!($a [$args, [$name: $ty], $tcx]);
         )*
     }
 }