]> git.proxmox.com Git - rustc.git/blame - compiler/rustc_middle/src/arena.rs
New upstream version 1.69.0+dfsg1
[rustc.git] / compiler / rustc_middle / src / arena.rs
CommitLineData
487cf647
FG
1#![allow(rustc::usage_of_ty_tykind)]
2
3c0e092e 3/// This higher-order macro declares a list of types which can be allocated by `Arena`.
ba9703b0 4///
f9f354fc 5/// Specifying the `decode` modifier will add decode impls for `&T` and `&[T]` where `T` is the type
ba9703b0
XL
6/// listed. These impls will appear in the implement_ty_decoder! macro.
7#[macro_export]
8macro_rules! arena_types {
3c0e092e 9 ($macro:path) => (
94222f64 10 $macro!([
9ffffee4 11 [] layout: rustc_target::abi::LayoutS,
3c0e092e 12 [] fn_abi: rustc_target::abi::call::FnAbi<'tcx, rustc_middle::ty::Ty<'tcx>>,
f9f354fc 13 // AdtDef are interned and compared by address
5e7ed085 14 [decode] adt_def: rustc_middle::ty::AdtDefData,
3c0e092e
XL
15 [] steal_thir: rustc_data_structures::steal::Steal<rustc_middle::thir::Thir<'tcx>>,
16 [] steal_mir: rustc_data_structures::steal::Steal<rustc_middle::mir::Body<'tcx>>,
17 [decode] mir: rustc_middle::mir::Body<'tcx>,
3dfed10e 18 [] steal_promoted:
fc512014 19 rustc_data_structures::steal::Steal<
3dfed10e
XL
20 rustc_index::vec::IndexVec<
21 rustc_middle::mir::Promoted,
3c0e092e 22 rustc_middle::mir::Body<'tcx>
3dfed10e
XL
23 >
24 >,
25 [decode] promoted:
26 rustc_index::vec::IndexVec<
27 rustc_middle::mir::Promoted,
3c0e092e 28 rustc_middle::mir::Body<'tcx>
3dfed10e 29 >,
3c0e092e 30 [decode] typeck_results: rustc_middle::ty::TypeckResults<'tcx>,
3dfed10e 31 [decode] borrowck_result:
3c0e092e 32 rustc_middle::mir::BorrowCheckResult<'tcx>,
9c376795
FG
33 [] resolver: rustc_data_structures::steal::Steal<(
34 rustc_middle::ty::ResolverAstLowering,
35 rustc_data_structures::sync::Lrc<rustc_ast::Crate>,
36 )>,
37 [] output_filenames: std::sync::Arc<rustc_session::config::OutputFilenames>,
9ffffee4
FG
38 [] metadata_loader: rustc_data_structures::steal::Steal<Box<rustc_session::cstore::MetadataLoaderDyn>>,
39 [] crate_for_resolver: rustc_data_structures::steal::Steal<rustc_ast::ast::Crate>,
9c376795 40 [] resolutions: rustc_middle::ty::ResolverGlobalCtxt,
3dfed10e 41 [decode] unsafety_check_result: rustc_middle::mir::UnsafetyCheckResult,
fc512014 42 [decode] code_region: rustc_middle::mir::coverage::CodeRegion,
3dfed10e 43 [] const_allocs: rustc_middle::mir::interpret::Allocation,
923072b8 44 [] region_scope_tree: rustc_middle::middle::region::ScopeTree,
f9f354fc 45 // Required for the incremental on-disk cache
3c0e092e 46 [] mir_keys: rustc_hir::def_id::DefIdSet,
ba9703b0
XL
47 [] dropck_outlives:
48 rustc_middle::infer::canonical::Canonical<'tcx,
49 rustc_middle::infer::canonical::QueryResponse<'tcx,
50 rustc_middle::traits::query::DropckOutlivesResult<'tcx>
51 >
52 >,
53 [] normalize_projection_ty:
54 rustc_middle::infer::canonical::Canonical<'tcx,
55 rustc_middle::infer::canonical::QueryResponse<'tcx,
56 rustc_middle::traits::query::NormalizationResult<'tcx>
57 >
58 >,
59 [] implied_outlives_bounds:
60 rustc_middle::infer::canonical::Canonical<'tcx,
61 rustc_middle::infer::canonical::QueryResponse<'tcx,
62 Vec<rustc_middle::traits::query::OutlivesBound<'tcx>>
63 >
64 >,
5e7ed085 65 [] dtorck_constraint: rustc_middle::traits::query::DropckConstraint<'tcx>,
5099ac24
FG
66 [] candidate_step: rustc_middle::traits::query::CandidateStep<'tcx>,
67 [] autoderef_bad_ty: rustc_middle::traits::query::MethodAutoderefBadTy<'tcx>,
064997fb 68 [] query_region_constraints: rustc_middle::infer::canonical::QueryRegionConstraints<'tcx>,
ba9703b0
XL
69 [] type_op_subtype:
70 rustc_middle::infer::canonical::Canonical<'tcx,
71 rustc_middle::infer::canonical::QueryResponse<'tcx, ()>
72 >,
73 [] type_op_normalize_poly_fn_sig:
74 rustc_middle::infer::canonical::Canonical<'tcx,
75 rustc_middle::infer::canonical::QueryResponse<'tcx, rustc_middle::ty::PolyFnSig<'tcx>>
76 >,
77 [] type_op_normalize_fn_sig:
78 rustc_middle::infer::canonical::Canonical<'tcx,
79 rustc_middle::infer::canonical::QueryResponse<'tcx, rustc_middle::ty::FnSig<'tcx>>
80 >,
81 [] type_op_normalize_predicate:
82 rustc_middle::infer::canonical::Canonical<'tcx,
83 rustc_middle::infer::canonical::QueryResponse<'tcx, rustc_middle::ty::Predicate<'tcx>>
84 >,
85 [] type_op_normalize_ty:
86 rustc_middle::infer::canonical::Canonical<'tcx,
87 rustc_middle::infer::canonical::QueryResponse<'tcx, rustc_middle::ty::Ty<'tcx>>
88 >,
3c0e092e 89 [] all_traits: Vec<rustc_hir::def_id::DefId>,
2b03887a 90 [] effective_visibilities: rustc_middle::middle::privacy::EffectiveVisibilities,
3c0e092e
XL
91 [] foreign_module: rustc_session::cstore::ForeignModule,
92 [] foreign_modules: Vec<rustc_session::cstore::ForeignModule>,
3dfed10e
XL
93 [] upvars_mentioned: rustc_data_structures::fx::FxIndexMap<rustc_hir::HirId, rustc_hir::Upvar>,
94 [] object_safety_violations: rustc_middle::traits::ObjectSafetyViolation,
3c0e092e 95 [] codegen_unit: rustc_middle::mir::mono::CodegenUnit<'tcx>,
923072b8 96 [decode] attribute: rustc_ast::Attribute,
3dfed10e
XL
97 [] name_set: rustc_data_structures::fx::FxHashSet<rustc_span::symbol::Symbol>,
98 [] hir_id_set: rustc_hir::HirIdSet,
ba9703b0
XL
99
100 // Interned types
487cf647
FG
101 [] tys: rustc_type_ir::WithCachedTypeInfo<rustc_middle::ty::TyKind<'tcx>>,
102 [] predicates: rustc_type_ir::WithCachedTypeInfo<rustc_middle::ty::PredicateKind<'tcx>>,
9c376795 103 [] consts: rustc_middle::ty::ConstData<'tcx>,
f9f354fc
XL
104
105 // Note that this deliberately duplicates items in the `rustc_hir::arena`,
106 // since we need to allocate this type on both the `rustc_hir` arena
107 // (during lowering) and the `librustc_middle` arena (for decoding MIR)
3dfed10e 108 [decode] asm_template: rustc_ast::InlineAsmTemplatePiece,
2b03887a 109 [decode] used_trait_imports: rustc_data_structures::unord::UnordSet<rustc_hir::def_id::LocalDefId>,
9ffffee4 110 [decode] is_late_bound_map: rustc_data_structures::fx::FxIndexSet<rustc_hir::ItemLocalId>,
5099ac24 111 [decode] impl_source: rustc_middle::traits::ImplSource<'tcx, ()>,
3c0e092e 112
f2b60f7d
FG
113 [] dep_kind: rustc_middle::dep_graph::DepKindStruct<'tcx>,
114
115 [decode] trait_impl_trait_tys: rustc_data_structures::fx::FxHashMap<rustc_hir::def_id::DefId, rustc_middle::ty::Ty<'tcx>>,
2b03887a 116 [] bit_set_u32: rustc_index::bit_set::BitSet<u32>,
9ffffee4
FG
117 [] external_constraints: rustc_middle::traits::solve::ExternalConstraintsData<'tcx>,
118 [decode] doc_link_resolutions: rustc_hir::def::DocLinkResMap,
119 [] closure_kind_origin: (rustc_span::Span, rustc_middle::hir::place::Place<'tcx>),
3c0e092e 120 ]);
ba9703b0
XL
121 )
122}
123
3c0e092e 124arena_types!(rustc_arena::declare_arena);