1 /// This higher-order macro declares a list of types which can be allocated by `Arena`.
2 ///
3 /// Specifying the `decode` modifier will add decode impls for `&T` and `&[T]`,
4 /// where `T` is the type listed. These impls will appear in the implement_ty_decoder! macro.
5 #[macro_export]
6 macro_rules! arena_types {
7     ($macro:path) => (
8         $macro!([
9             // HIR types
10             [] hir_krate: rustc_hir::Crate<'tcx>,
11             [] arm: rustc_hir::Arm<'tcx>,
12             [] asm_operand: (rustc_hir::InlineAsmOperand<'tcx>, Span),
13             [] asm_template: rustc_ast::InlineAsmTemplatePiece,
14             [] attribute: rustc_ast::Attribute,
15             [] block: rustc_hir::Block<'tcx>,
16             [] bare_fn_ty: rustc_hir::BareFnTy<'tcx>,
17             [] body: rustc_hir::Body<'tcx>,
18             [] generic_arg: rustc_hir::GenericArg<'tcx>,
19             [] generic_args: rustc_hir::GenericArgs<'tcx>,
20             [] generic_bound: rustc_hir::GenericBound<'tcx>,
21             [] generic_param: rustc_hir::GenericParam<'tcx>,
22             [] expr: rustc_hir::Expr<'tcx>,
23             [] expr_field: rustc_hir::ExprField<'tcx>,
24             [] pat_field: rustc_hir::PatField<'tcx>,
25             [] fn_decl: rustc_hir::FnDecl<'tcx>,
26             [] foreign_item: rustc_hir::ForeignItem<'tcx>,
27             [] foreign_item_ref: rustc_hir::ForeignItemRef,
28             [] impl_item: rustc_hir::ImplItem<'tcx>,
29             [] impl_item_ref: rustc_hir::ImplItemRef,
30             [] item: rustc_hir::Item<'tcx>,
31             [] inline_asm: rustc_hir::InlineAsm<'tcx>,
32             [] llvm_inline_asm: rustc_hir::LlvmInlineAsm<'tcx>,
33             [] local: rustc_hir::Local<'tcx>,
34             [] mod_: rustc_hir::Mod<'tcx>,
35             [] owner_info: rustc_hir::OwnerInfo<'tcx>,
36             [] param: rustc_hir::Param<'tcx>,
37             [] pat: rustc_hir::Pat<'tcx>,
38             [] path: rustc_hir::Path<'tcx>,
39             [] path_segment: rustc_hir::PathSegment<'tcx>,
40             [] poly_trait_ref: rustc_hir::PolyTraitRef<'tcx>,
41             [] qpath: rustc_hir::QPath<'tcx>,
42             [] stmt: rustc_hir::Stmt<'tcx>,
43             [] field_def: rustc_hir::FieldDef<'tcx>,
44             [] trait_item: rustc_hir::TraitItem<'tcx>,
45             [] trait_item_ref: rustc_hir::TraitItemRef,
46             [] ty: rustc_hir::Ty<'tcx>,
47             [] type_binding: rustc_hir::TypeBinding<'tcx>,
48             [] variant: rustc_hir::Variant<'tcx>,
49             [] where_predicate: rustc_hir::WherePredicate<'tcx>,
50         ]);
51     )
52 }
53