]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_middle/src/arena.rs
Rollup merge of #105340 - estebank:ice-ice-baby, r=compiler-errors
[rust.git] / compiler / rustc_middle / src / arena.rs
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]` where `T` is the type
4 /// 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             [] layout: rustc_target::abi::LayoutS<rustc_target::abi::VariantIdx>,
10             [] fn_abi: rustc_target::abi::call::FnAbi<'tcx, rustc_middle::ty::Ty<'tcx>>,
11             // AdtDef are interned and compared by address
12             [decode] adt_def: rustc_middle::ty::AdtDefData,
13             [] steal_thir: rustc_data_structures::steal::Steal<rustc_middle::thir::Thir<'tcx>>,
14             [] steal_mir: rustc_data_structures::steal::Steal<rustc_middle::mir::Body<'tcx>>,
15             [decode] mir: rustc_middle::mir::Body<'tcx>,
16             [] steal_promoted:
17                 rustc_data_structures::steal::Steal<
18                     rustc_index::vec::IndexVec<
19                         rustc_middle::mir::Promoted,
20                         rustc_middle::mir::Body<'tcx>
21                     >
22                 >,
23             [decode] promoted:
24                 rustc_index::vec::IndexVec<
25                     rustc_middle::mir::Promoted,
26                     rustc_middle::mir::Body<'tcx>
27                 >,
28             [decode] typeck_results: rustc_middle::ty::TypeckResults<'tcx>,
29             [decode] borrowck_result:
30                 rustc_middle::mir::BorrowCheckResult<'tcx>,
31             [] resolver: rustc_data_structures::steal::Steal<rustc_middle::ty::ResolverAstLowering>,
32             [decode] unsafety_check_result: rustc_middle::mir::UnsafetyCheckResult,
33             [decode] code_region: rustc_middle::mir::coverage::CodeRegion,
34             [] const_allocs: rustc_middle::mir::interpret::Allocation,
35             [] region_scope_tree: rustc_middle::middle::region::ScopeTree,
36             // Required for the incremental on-disk cache
37             [] mir_keys: rustc_hir::def_id::DefIdSet,
38             [] dropck_outlives:
39                 rustc_middle::infer::canonical::Canonical<'tcx,
40                     rustc_middle::infer::canonical::QueryResponse<'tcx,
41                         rustc_middle::traits::query::DropckOutlivesResult<'tcx>
42                     >
43                 >,
44             [] normalize_projection_ty:
45                 rustc_middle::infer::canonical::Canonical<'tcx,
46                     rustc_middle::infer::canonical::QueryResponse<'tcx,
47                         rustc_middle::traits::query::NormalizationResult<'tcx>
48                     >
49                 >,
50             [] implied_outlives_bounds:
51                 rustc_middle::infer::canonical::Canonical<'tcx,
52                     rustc_middle::infer::canonical::QueryResponse<'tcx,
53                         Vec<rustc_middle::traits::query::OutlivesBound<'tcx>>
54                     >
55                 >,
56             [] dtorck_constraint: rustc_middle::traits::query::DropckConstraint<'tcx>,
57             [] candidate_step: rustc_middle::traits::query::CandidateStep<'tcx>,
58             [] autoderef_bad_ty: rustc_middle::traits::query::MethodAutoderefBadTy<'tcx>,
59             [] query_region_constraints: rustc_middle::infer::canonical::QueryRegionConstraints<'tcx>,
60             [] type_op_subtype:
61                 rustc_middle::infer::canonical::Canonical<'tcx,
62                     rustc_middle::infer::canonical::QueryResponse<'tcx, ()>
63                 >,
64             [] type_op_normalize_poly_fn_sig:
65                 rustc_middle::infer::canonical::Canonical<'tcx,
66                     rustc_middle::infer::canonical::QueryResponse<'tcx, rustc_middle::ty::PolyFnSig<'tcx>>
67                 >,
68             [] type_op_normalize_fn_sig:
69                 rustc_middle::infer::canonical::Canonical<'tcx,
70                     rustc_middle::infer::canonical::QueryResponse<'tcx, rustc_middle::ty::FnSig<'tcx>>
71                 >,
72             [] type_op_normalize_predicate:
73                 rustc_middle::infer::canonical::Canonical<'tcx,
74                     rustc_middle::infer::canonical::QueryResponse<'tcx, rustc_middle::ty::Predicate<'tcx>>
75                 >,
76             [] type_op_normalize_ty:
77                 rustc_middle::infer::canonical::Canonical<'tcx,
78                     rustc_middle::infer::canonical::QueryResponse<'tcx, rustc_middle::ty::Ty<'tcx>>
79                 >,
80             [] all_traits: Vec<rustc_hir::def_id::DefId>,
81             [] effective_visibilities: rustc_middle::middle::privacy::EffectiveVisibilities,
82             [] foreign_module: rustc_session::cstore::ForeignModule,
83             [] foreign_modules: Vec<rustc_session::cstore::ForeignModule>,
84             [] upvars_mentioned: rustc_data_structures::fx::FxIndexMap<rustc_hir::HirId, rustc_hir::Upvar>,
85             [] object_safety_violations: rustc_middle::traits::ObjectSafetyViolation,
86             [] codegen_unit: rustc_middle::mir::mono::CodegenUnit<'tcx>,
87             [decode] attribute: rustc_ast::Attribute,
88             [] name_set: rustc_data_structures::fx::FxHashSet<rustc_span::symbol::Symbol>,
89             [] hir_id_set: rustc_hir::HirIdSet,
90
91             // Interned types
92             [] tys: rustc_data_structures::intern::WithStableHash<rustc_middle::ty::TyS<'tcx>>,
93             [] predicates: rustc_data_structures::intern::WithStableHash<rustc_middle::ty::PredicateS<'tcx>>,
94             [] consts: rustc_middle::ty::ConstS<'tcx>,
95
96             // Note that this deliberately duplicates items in the `rustc_hir::arena`,
97             // since we need to allocate this type on both the `rustc_hir` arena
98             // (during lowering) and the `librustc_middle` arena (for decoding MIR)
99             [decode] asm_template: rustc_ast::InlineAsmTemplatePiece,
100             [decode] used_trait_imports: rustc_data_structures::unord::UnordSet<rustc_hir::def_id::LocalDefId>,
101             [decode] is_late_bound_map: rustc_data_structures::fx::FxIndexSet<rustc_hir::def_id::LocalDefId>,
102             [decode] impl_source: rustc_middle::traits::ImplSource<'tcx, ()>,
103
104             [] dep_kind: rustc_middle::dep_graph::DepKindStruct<'tcx>,
105
106             [decode] trait_impl_trait_tys: rustc_data_structures::fx::FxHashMap<rustc_hir::def_id::DefId, rustc_middle::ty::Ty<'tcx>>,
107             [] bit_set_u32: rustc_index::bit_set::BitSet<u32>,
108         ]);
109     )
110 }
111
112 arena_types!(rustc_arena::declare_arena);