1 /// This declares a list of types which can be allocated by `Arena`.
3 /// The `few` modifier will cause allocation to use the shared arena and recording the destructor.
4 /// This is faster and more memory efficient if there's only a few allocations of the type.
5 /// Leaving `few` out will cause the type to get its own dedicated `TypedArena` which is
6 /// faster and more memory efficient if there is lots of allocations.
8 /// Specifying the `decode` modifier will add decode impls for `&T` and `&[T]`,
9 /// where `T` is the type listed. These impls will appear in the implement_ty_decoder! macro.
11 macro_rules! arena_types {
12 ($macro:path, $args:tt, $tcx:lifetime) => (
15 [few] hir_krate: rustc_hir::Crate<$tcx>, rustc_hir::Crate<'_x>;
16 [] arm: rustc_hir::Arm<$tcx>, rustc_hir::Arm<'_x>;
17 [] asm_operand: rustc_hir::InlineAsmOperand<$tcx>, rustc_hir::InlineAsmOperand<'_x>;
18 [] asm_template: rustc_ast::ast::InlineAsmTemplatePiece, rustc_ast::ast::InlineAsmTemplatePiece;
19 [] attribute: rustc_ast::ast::Attribute, rustc_ast::ast::Attribute;
20 [] block: rustc_hir::Block<$tcx>, rustc_hir::Block<'_x>;
21 [] bare_fn_ty: rustc_hir::BareFnTy<$tcx>, rustc_hir::BareFnTy<'_x>;
22 [few] global_asm: rustc_hir::GlobalAsm, rustc_hir::GlobalAsm;
23 [] generic_arg: rustc_hir::GenericArg<$tcx>, rustc_hir::GenericArg<'_x>;
24 [] generic_args: rustc_hir::GenericArgs<$tcx>, rustc_hir::GenericArgs<'_x>;
25 [] generic_bound: rustc_hir::GenericBound<$tcx>, rustc_hir::GenericBound<'_x>;
26 [] generic_param: rustc_hir::GenericParam<$tcx>, rustc_hir::GenericParam<'_x>;
27 [] expr: rustc_hir::Expr<$tcx>, rustc_hir::Expr<'_x>;
28 [] field: rustc_hir::Field<$tcx>, rustc_hir::Field<'_x>;
29 [] field_pat: rustc_hir::FieldPat<$tcx>, rustc_hir::FieldPat<'_x>;
30 [] fn_decl: rustc_hir::FnDecl<$tcx>, rustc_hir::FnDecl<'_x>;
31 [] foreign_item: rustc_hir::ForeignItem<$tcx>, rustc_hir::ForeignItem<'_x>;
32 [] impl_item_ref: rustc_hir::ImplItemRef<$tcx>, rustc_hir::ImplItemRef<'_x>;
33 [few] inline_asm: rustc_hir::InlineAsm<$tcx>, rustc_hir::InlineAsm<'_x>;
34 [few] llvm_inline_asm: rustc_hir::LlvmInlineAsm<$tcx>, rustc_hir::LlvmInlineAsm<'_x>;
35 [] local: rustc_hir::Local<$tcx>, rustc_hir::Local<'_x>;
36 [few] macro_def: rustc_hir::MacroDef<$tcx>, rustc_hir::MacroDef<'_x>;
37 [] param: rustc_hir::Param<$tcx>, rustc_hir::Param<'_x>;
38 [] pat: rustc_hir::Pat<$tcx>, rustc_hir::Pat<'_x>;
39 [] path: rustc_hir::Path<$tcx>, rustc_hir::Path<'_x>;
40 [] path_segment: rustc_hir::PathSegment<$tcx>, rustc_hir::PathSegment<'_x>;
41 [] poly_trait_ref: rustc_hir::PolyTraitRef<$tcx>, rustc_hir::PolyTraitRef<'_x>;
42 [] qpath: rustc_hir::QPath<$tcx>, rustc_hir::QPath<'_x>;
43 [] stmt: rustc_hir::Stmt<$tcx>, rustc_hir::Stmt<'_x>;
44 [] struct_field: rustc_hir::StructField<$tcx>, rustc_hir::StructField<'_x>;
45 [] trait_item_ref: rustc_hir::TraitItemRef, rustc_hir::TraitItemRef;
46 [] ty: rustc_hir::Ty<$tcx>, rustc_hir::Ty<'_x>;
47 [] type_binding: rustc_hir::TypeBinding<$tcx>, rustc_hir::TypeBinding<'_x>;
48 [] variant: rustc_hir::Variant<$tcx>, rustc_hir::Variant<'_x>;
49 [] where_predicate: rustc_hir::WherePredicate<$tcx>, rustc_hir::WherePredicate<'_x>;