+#[macro_export]
+macro_rules! impl_arena_allocatable_decoder {
+ ([]$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> {
+ decode_arena_allocable(self)
+ }
+ }
+
+ impl<$($typaram),*> SpecializedDecoder<&$tcx [$ty]> for $DecoderName<$($typaram),*> {
+ #[inline]
+ fn specialized_decode(&mut self) -> Result<&$tcx [$ty], Self::Error> {
+ decode_arena_allocable_slice(self)
+ }
+ }
+ };
+ ([$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!($a [$args, [$name: $ty], $tcx]);
+ )*
+ }
+}
+