Skip to main content

rustc_middle/
arena.rs

1//! Declares [`rustc_middle::arena::Arena`], which can allocate values of any
2//! `Copy` type, and any `!Copy` type explicitly listed below.
3
4use rustc_serialize::Decodable;
5use rustc_span::{Span, Spanned};
6
7use crate::mono::MonoItem;
8use crate::ty::codec::{RefDecodable, TyDecoder};
9use crate::ty::{self, Ty, TyCtxt};
10
11// If a type `T` supported by the arena also needs to support decoding into `&'tcx T`
12// backed by an arena allocation (via `RefDecodable`), add it to the list in
13// `impl_ref_decodable_into_arena!`.
14
15pub struct Arena<'tcx> {
    pub dropless: ::rustc_arena::DroplessArena,
    layout: ::rustc_arena::TypedArena<rustc_abi::LayoutData<rustc_abi::FieldIdx,
    rustc_abi::VariantIdx>>,
    proxy_coroutine_layout: ::rustc_arena::TypedArena<rustc_middle::mir::CoroutineLayout<'tcx>>,
    fn_abi: ::rustc_arena::TypedArena<rustc_target::callconv::FnAbi<'tcx,
    Ty<'tcx>>>,
    adt_def: ::rustc_arena::TypedArena<rustc_middle::ty::AdtDefData>,
    steal_thir: ::rustc_arena::TypedArena<rustc_data_structures::steal::Steal<rustc_middle::thir::Thir<'tcx>>>,
    steal_mir: ::rustc_arena::TypedArena<rustc_data_structures::steal::Steal<rustc_middle::mir::Body<'tcx>>>,
    mir: ::rustc_arena::TypedArena<rustc_middle::mir::Body<'tcx>>,
    steal_promoted: ::rustc_arena::TypedArena<rustc_data_structures::steal::Steal<rustc_index::IndexVec<rustc_middle::mir::Promoted,
    rustc_middle::mir::Body<'tcx>>>>,
    promoted: ::rustc_arena::TypedArena<rustc_index::IndexVec<rustc_middle::mir::Promoted,
    rustc_middle::mir::Body<'tcx>>>,
    typeck_results: ::rustc_arena::TypedArena<rustc_middle::ty::TypeckResults<'tcx>>,
    borrowck_result: ::rustc_arena::TypedArena<rustc_data_structures::fx::FxIndexMap<rustc_hir::def_id::LocalDefId,
    rustc_middle::ty::DefinitionSiteHiddenType<'tcx>>>,
    resolver: ::rustc_arena::TypedArena<rustc_data_structures::steal::Steal<rustc_middle::middle::resolve::ResolverAstLowering<'tcx>>>,
    index_ast: ::rustc_arena::TypedArena<rustc_data_structures::steal::Steal<(std::sync::Arc<rustc_middle::middle::resolve::ResolverAstLowering<'tcx>>,
    rustc_middle::middle::resolve::AstOwner)>>,
    crate_alone: ::rustc_arena::TypedArena<rustc_data_structures::steal::Steal<rustc_ast::Crate>>,
    crate_for_resolver: ::rustc_arena::TypedArena<rustc_data_structures::steal::Steal<(rustc_ast::Crate,
    rustc_ast::AttrVec)>>,
    resolutions: ::rustc_arena::TypedArena<rustc_middle::middle::resolve::ResolverGlobalCtxt>,
    const_allocs: ::rustc_arena::TypedArena<rustc_middle::mir::interpret::Allocation>,
    region_scope_tree: ::rustc_arena::TypedArena<rustc_middle::middle::region::ScopeTree>,
    mir_keys: ::rustc_arena::TypedArena<rustc_hir::def_id::DefIdSet>,
    dropck_outlives: ::rustc_arena::TypedArena<rustc_middle::infer::canonical::Canonical<'tcx,
    rustc_middle::infer::canonical::QueryResponse<'tcx,
    rustc_middle::traits::query::DropckOutlivesResult<'tcx>>>>,
    normalize_canonicalized_projection: ::rustc_arena::TypedArena<rustc_middle::infer::canonical::Canonical<'tcx,
    rustc_middle::infer::canonical::QueryResponse<'tcx,
    rustc_middle::traits::query::NormalizationResult<'tcx>>>>,
    implied_outlives_bounds: ::rustc_arena::TypedArena<rustc_middle::infer::canonical::Canonical<'tcx,
    rustc_middle::infer::canonical::QueryResponse<'tcx,
    Vec<rustc_middle::traits::query::OutlivesBound<'tcx>>>>>,
    mir_borrowck_implied_outlives_bounds: ::rustc_arena::TypedArena<rustc_middle::infer::canonical::Canonical<'tcx,
    rustc_middle::infer::canonical::QueryResponse<'tcx,
    rustc_middle::traits::query::MirBorrowckImpliedOutlivesBounds<'tcx>>>>,
    dtorck_constraint: ::rustc_arena::TypedArena<rustc_middle::traits::query::DropckConstraint<'tcx>>,
    candidate_step: ::rustc_arena::TypedArena<rustc_middle::traits::query::CandidateStep<'tcx>>,
    autoderef_bad_ty: ::rustc_arena::TypedArena<rustc_middle::traits::query::MethodAutoderefBadTy<'tcx>>,
    query_region_constraints: ::rustc_arena::TypedArena<rustc_middle::infer::canonical::QueryRegionConstraints<'tcx>>,
    type_op_subtype: ::rustc_arena::TypedArena<rustc_middle::infer::canonical::Canonical<'tcx,
    rustc_middle::infer::canonical::QueryResponse<'tcx, ()>>>,
    type_op_normalize_poly_fn_sig: ::rustc_arena::TypedArena<rustc_middle::infer::canonical::Canonical<'tcx,
    rustc_middle::infer::canonical::QueryResponse<'tcx,
    rustc_middle::ty::PolyFnSig<'tcx>>>>,
    type_op_normalize_fn_sig: ::rustc_arena::TypedArena<rustc_middle::infer::canonical::Canonical<'tcx,
    rustc_middle::infer::canonical::QueryResponse<'tcx,
    rustc_middle::ty::FnSig<'tcx>>>>,
    type_op_normalize_clause: ::rustc_arena::TypedArena<rustc_middle::infer::canonical::Canonical<'tcx,
    rustc_middle::infer::canonical::QueryResponse<'tcx,
    rustc_middle::ty::Clause<'tcx>>>>,
    type_op_normalize_ty: ::rustc_arena::TypedArena<rustc_middle::infer::canonical::Canonical<'tcx,
    rustc_middle::infer::canonical::QueryResponse<'tcx, Ty<'tcx>>>>,
    inspect_probe: ::rustc_arena::TypedArena<rustc_middle::traits::solve::inspect::Probe<TyCtxt<'tcx>>>,
    effective_visibilities: ::rustc_arena::TypedArena<rustc_middle::middle::privacy::EffectiveVisibilities>,
    upvars_mentioned: ::rustc_arena::TypedArena<rustc_data_structures::fx::FxIndexMap<rustc_hir::HirId,
    rustc_hir::Upvar>>,
    dyn_compatibility_violations: ::rustc_arena::TypedArena<rustc_middle::traits::DynCompatibilityViolation>,
    codegen_unit: ::rustc_arena::TypedArena<rustc_middle::mono::CodegenUnit<'tcx>>,
    attribute: ::rustc_arena::TypedArena<rustc_attr_ir::Attribute>,
    name_set: ::rustc_arena::TypedArena<rustc_data_structures::unord::UnordSet<rustc_span::Symbol>>,
    autodiff_item: ::rustc_arena::TypedArena<rustc_attr_ir::AutoDiffItem>,
    ordered_name_set: ::rustc_arena::TypedArena<rustc_data_structures::fx::FxIndexSet<rustc_span::Symbol>>,
    stable_order_of_exportable_impls: ::rustc_arena::TypedArena<rustc_data_structures::fx::FxIndexMap<rustc_hir::def_id::DefId,
    usize>>,
    asm_template: ::rustc_arena::TypedArena<rustc_ast::InlineAsmTemplatePiece>,
    used_trait_imports: ::rustc_arena::TypedArena<rustc_data_structures::unord::UnordSet<rustc_hir::def_id::LocalDefId>>,
    is_late_bound_map: ::rustc_arena::TypedArena<rustc_data_structures::fx::FxIndexSet<rustc_hir::ItemLocalId>>,
    impl_source: ::rustc_arena::TypedArena<rustc_middle::traits::ImplSource<'tcx,
    ()>>,
    dep_kind_vtable: ::rustc_arena::TypedArena<rustc_middle::dep_graph::DepKindVTable<'tcx>>,
    trait_impl_trait_tys: ::rustc_arena::TypedArena<rustc_data_structures::unord::UnordMap<rustc_hir::def_id::DefId,
    rustc_middle::ty::EarlyBinder<'tcx, Ty<'tcx>>>>,
    external_constraints: ::rustc_arena::TypedArena<rustc_middle::traits::solve::ExternalConstraintsData<TyCtxt<'tcx>>>,
    doc_link_resolutions: ::rustc_arena::TypedArena<rustc_middle::middle::resolve::DocLinkResMap>,
    stripped_cfg_items: ::rustc_arena::TypedArena<rustc_attr_ir::StrippedCfgItem>,
    mod_child: ::rustc_arena::TypedArena<rustc_middle::middle::resolve::ModChild>,
    features: ::rustc_arena::TypedArena<rustc_feature::Features>,
    specialization_graph: ::rustc_arena::TypedArena<rustc_middle::traits::specialization_graph::Graph>,
    crate_inherent_impls: ::rustc_arena::TypedArena<rustc_middle::ty::CrateInherentImpls>,
    hir_owner_nodes: ::rustc_arena::TypedArena<rustc_hir::OwnerNodes<'tcx>>,
    token_stream: ::rustc_arena::TypedArena<rustc_ast::tokenstream::TokenStream>,
    parenting: ::rustc_arena::TypedArena<rustc_hir::def_id::LocalDefIdMap<rustc_hir::ItemLocalId>>,
    trait_candidates: ::rustc_arena::TypedArena<rustc_hir::ItemLocalMap<&'tcx [rustc_hir::TraitCandidate<'tcx>]>>,
    delayed_lints: ::rustc_arena::TypedArena<rustc_data_structures::steal::Steal<rustc_hir::lints::DelayedLints>>,
}
#[automatically_derived]
impl<'tcx> ::core::default::Default for Arena<'tcx> {
    #[inline]
    fn default() -> Self {
        Self {
            dropless: ::core::default::Default::default(),
            layout: ::core::default::Default::default(),
            proxy_coroutine_layout: ::core::default::Default::default(),
            fn_abi: ::core::default::Default::default(),
            adt_def: ::core::default::Default::default(),
            steal_thir: ::core::default::Default::default(),
            steal_mir: ::core::default::Default::default(),
            mir: ::core::default::Default::default(),
            steal_promoted: ::core::default::Default::default(),
            promoted: ::core::default::Default::default(),
            typeck_results: ::core::default::Default::default(),
            borrowck_result: ::core::default::Default::default(),
            resolver: ::core::default::Default::default(),
            index_ast: ::core::default::Default::default(),
            crate_alone: ::core::default::Default::default(),
            crate_for_resolver: ::core::default::Default::default(),
            resolutions: ::core::default::Default::default(),
            const_allocs: ::core::default::Default::default(),
            region_scope_tree: ::core::default::Default::default(),
            mir_keys: ::core::default::Default::default(),
            dropck_outlives: ::core::default::Default::default(),
            normalize_canonicalized_projection: ::core::default::Default::default(),
            implied_outlives_bounds: ::core::default::Default::default(),
            mir_borrowck_implied_outlives_bounds: ::core::default::Default::default(),
            dtorck_constraint: ::core::default::Default::default(),
            candidate_step: ::core::default::Default::default(),
            autoderef_bad_ty: ::core::default::Default::default(),
            query_region_constraints: ::core::default::Default::default(),
            type_op_subtype: ::core::default::Default::default(),
            type_op_normalize_poly_fn_sig: ::core::default::Default::default(),
            type_op_normalize_fn_sig: ::core::default::Default::default(),
            type_op_normalize_clause: ::core::default::Default::default(),
            type_op_normalize_ty: ::core::default::Default::default(),
            inspect_probe: ::core::default::Default::default(),
            effective_visibilities: ::core::default::Default::default(),
            upvars_mentioned: ::core::default::Default::default(),
            dyn_compatibility_violations: ::core::default::Default::default(),
            codegen_unit: ::core::default::Default::default(),
            attribute: ::core::default::Default::default(),
            name_set: ::core::default::Default::default(),
            autodiff_item: ::core::default::Default::default(),
            ordered_name_set: ::core::default::Default::default(),
            stable_order_of_exportable_impls: ::core::default::Default::default(),
            asm_template: ::core::default::Default::default(),
            used_trait_imports: ::core::default::Default::default(),
            is_late_bound_map: ::core::default::Default::default(),
            impl_source: ::core::default::Default::default(),
            dep_kind_vtable: ::core::default::Default::default(),
            trait_impl_trait_tys: ::core::default::Default::default(),
            external_constraints: ::core::default::Default::default(),
            doc_link_resolutions: ::core::default::Default::default(),
            stripped_cfg_items: ::core::default::Default::default(),
            mod_child: ::core::default::Default::default(),
            features: ::core::default::Default::default(),
            specialization_graph: ::core::default::Default::default(),
            crate_inherent_impls: ::core::default::Default::default(),
            hir_owner_nodes: ::core::default::Default::default(),
            token_stream: ::core::default::Default::default(),
            parenting: ::core::default::Default::default(),
            trait_candidates: ::core::default::Default::default(),
            delayed_lints: ::core::default::Default::default(),
        }
    }
}
pub trait ArenaAllocatable<'tcx, C = rustc_arena::IsNotCopy>: Sized {
    #[allow(clippy :: mut_from_ref)]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>)
    -> &'tcx mut Self;
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
    iter: impl ::std::iter::IntoIterator<Item = Self>)
    -> &'tcx mut [Self];
}
impl<'tcx, T: Copy> ArenaAllocatable<'tcx, rustc_arena::IsCopy> for T {
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        arena.dropless.alloc(self)
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        arena.dropless.alloc_from_iter(iter)
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_abi::LayoutData<rustc_abi::FieldIdx, rustc_abi::VariantIdx> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.layout.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.layout.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::mir::CoroutineLayout<'tcx> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.proxy_coroutine_layout.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.proxy_coroutine_layout.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_target::callconv::FnAbi<'tcx, Ty<'tcx>> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.fn_abi.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.fn_abi.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::ty::AdtDefData {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.adt_def.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.adt_def.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_data_structures::steal::Steal<rustc_middle::thir::Thir<'tcx>> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.steal_thir.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.steal_thir.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_data_structures::steal::Steal<rustc_middle::mir::Body<'tcx>> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.steal_mir.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.steal_mir.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::mir::Body<'tcx> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.mir.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.mir.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_data_structures::steal::Steal<rustc_index::IndexVec<rustc_middle::mir::Promoted,
    rustc_middle::mir::Body<'tcx>>> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.steal_promoted.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.steal_promoted.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_index::IndexVec<rustc_middle::mir::Promoted,
    rustc_middle::mir::Body<'tcx>> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.promoted.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.promoted.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::ty::TypeckResults<'tcx> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.typeck_results.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.typeck_results.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_data_structures::fx::FxIndexMap<rustc_hir::def_id::LocalDefId,
    rustc_middle::ty::DefinitionSiteHiddenType<'tcx>> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.borrowck_result.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.borrowck_result.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_data_structures::steal::Steal<rustc_middle::middle::resolve::ResolverAstLowering<'tcx>>
    {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.resolver.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.resolver.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_data_structures::steal::Steal<(std::sync::Arc<rustc_middle::middle::resolve::ResolverAstLowering<'tcx>>,
    rustc_middle::middle::resolve::AstOwner)> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.index_ast.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.index_ast.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_data_structures::steal::Steal<rustc_ast::Crate> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.crate_alone.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.crate_alone.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_data_structures::steal::Steal<(rustc_ast::Crate,
    rustc_ast::AttrVec)> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.crate_for_resolver.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.crate_for_resolver.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::middle::resolve::ResolverGlobalCtxt {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.resolutions.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.resolutions.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::mir::interpret::Allocation {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.const_allocs.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.const_allocs.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::middle::region::ScopeTree {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.region_scope_tree.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.region_scope_tree.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_hir::def_id::DefIdSet {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.mir_keys.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.mir_keys.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::infer::canonical::Canonical<'tcx,
    rustc_middle::infer::canonical::QueryResponse<'tcx,
    rustc_middle::traits::query::DropckOutlivesResult<'tcx>>> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.dropck_outlives.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.dropck_outlives.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::infer::canonical::Canonical<'tcx,
    rustc_middle::infer::canonical::QueryResponse<'tcx,
    rustc_middle::traits::query::NormalizationResult<'tcx>>> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.normalize_canonicalized_projection.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else {
            arena.normalize_canonicalized_projection.alloc_from_iter(iter)
        }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::infer::canonical::Canonical<'tcx,
    rustc_middle::infer::canonical::QueryResponse<'tcx,
    Vec<rustc_middle::traits::query::OutlivesBound<'tcx>>>> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.implied_outlives_bounds.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.implied_outlives_bounds.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::infer::canonical::Canonical<'tcx,
    rustc_middle::infer::canonical::QueryResponse<'tcx,
    rustc_middle::traits::query::MirBorrowckImpliedOutlivesBounds<'tcx>>> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.mir_borrowck_implied_outlives_bounds.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else {
            arena.mir_borrowck_implied_outlives_bounds.alloc_from_iter(iter)
        }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::traits::query::DropckConstraint<'tcx> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.dtorck_constraint.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.dtorck_constraint.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::traits::query::CandidateStep<'tcx> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.candidate_step.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.candidate_step.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::traits::query::MethodAutoderefBadTy<'tcx> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.autoderef_bad_ty.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.autoderef_bad_ty.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::infer::canonical::QueryRegionConstraints<'tcx> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.query_region_constraints.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.query_region_constraints.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::infer::canonical::Canonical<'tcx,
    rustc_middle::infer::canonical::QueryResponse<'tcx, ()>> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.type_op_subtype.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.type_op_subtype.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::infer::canonical::Canonical<'tcx,
    rustc_middle::infer::canonical::QueryResponse<'tcx,
    rustc_middle::ty::PolyFnSig<'tcx>>> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.type_op_normalize_poly_fn_sig.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.type_op_normalize_poly_fn_sig.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::infer::canonical::Canonical<'tcx,
    rustc_middle::infer::canonical::QueryResponse<'tcx,
    rustc_middle::ty::FnSig<'tcx>>> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.type_op_normalize_fn_sig.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.type_op_normalize_fn_sig.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::infer::canonical::Canonical<'tcx,
    rustc_middle::infer::canonical::QueryResponse<'tcx,
    rustc_middle::ty::Clause<'tcx>>> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.type_op_normalize_clause.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.type_op_normalize_clause.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::infer::canonical::Canonical<'tcx,
    rustc_middle::infer::canonical::QueryResponse<'tcx, Ty<'tcx>>> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.type_op_normalize_ty.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.type_op_normalize_ty.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::traits::solve::inspect::Probe<TyCtxt<'tcx>> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.inspect_probe.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.inspect_probe.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::middle::privacy::EffectiveVisibilities {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.effective_visibilities.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.effective_visibilities.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_data_structures::fx::FxIndexMap<rustc_hir::HirId, rustc_hir::Upvar>
    {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.upvars_mentioned.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.upvars_mentioned.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::traits::DynCompatibilityViolation {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.dyn_compatibility_violations.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.dyn_compatibility_violations.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::mono::CodegenUnit<'tcx> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.codegen_unit.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.codegen_unit.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_attr_ir::Attribute {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.attribute.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.attribute.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_data_structures::unord::UnordSet<rustc_span::Symbol> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.name_set.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.name_set.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_attr_ir::AutoDiffItem {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.autodiff_item.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.autodiff_item.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_data_structures::fx::FxIndexSet<rustc_span::Symbol> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.ordered_name_set.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.ordered_name_set.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_data_structures::fx::FxIndexMap<rustc_hir::def_id::DefId, usize> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.stable_order_of_exportable_impls.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else {
            arena.stable_order_of_exportable_impls.alloc_from_iter(iter)
        }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_ast::InlineAsmTemplatePiece {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.asm_template.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.asm_template.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_data_structures::unord::UnordSet<rustc_hir::def_id::LocalDefId> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.used_trait_imports.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.used_trait_imports.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_data_structures::fx::FxIndexSet<rustc_hir::ItemLocalId> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.is_late_bound_map.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.is_late_bound_map.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::traits::ImplSource<'tcx, ()> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.impl_source.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.impl_source.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::dep_graph::DepKindVTable<'tcx> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.dep_kind_vtable.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.dep_kind_vtable.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_data_structures::unord::UnordMap<rustc_hir::def_id::DefId,
    rustc_middle::ty::EarlyBinder<'tcx, Ty<'tcx>>> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.trait_impl_trait_tys.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.trait_impl_trait_tys.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::traits::solve::ExternalConstraintsData<TyCtxt<'tcx>> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.external_constraints.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.external_constraints.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::middle::resolve::DocLinkResMap {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.doc_link_resolutions.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.doc_link_resolutions.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_attr_ir::StrippedCfgItem {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.stripped_cfg_items.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.stripped_cfg_items.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::middle::resolve::ModChild {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.mod_child.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.mod_child.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_feature::Features {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.features.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.features.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::traits::specialization_graph::Graph {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.specialization_graph.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.specialization_graph.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_middle::ty::CrateInherentImpls {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.crate_inherent_impls.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.crate_inherent_impls.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_hir::OwnerNodes<'tcx> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.hir_owner_nodes.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.hir_owner_nodes.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_ast::tokenstream::TokenStream {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.token_stream.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.token_stream.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_hir::def_id::LocalDefIdMap<rustc_hir::ItemLocalId> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.parenting.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.parenting.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_hir::ItemLocalMap<&'tcx [rustc_hir::TraitCandidate<'tcx>]> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.trait_candidates.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.trait_candidates.alloc_from_iter(iter) }
    }
}
impl<'tcx> ArenaAllocatable<'tcx, rustc_arena::IsNotCopy> for
    rustc_data_structures::steal::Steal<rustc_hir::lints::DelayedLints> {
    #[inline]
    fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc(self)
        } else { arena.delayed_lints.alloc(self) }
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    fn allocate_from_iter(arena: &'tcx Arena<'tcx>,
        iter: impl ::std::iter::IntoIterator<Item = Self>)
        -> &'tcx mut [Self] {
        if !::std::mem::needs_drop::<Self>() {
            arena.dropless.alloc_from_iter(iter)
        } else { arena.delayed_lints.alloc_from_iter(iter) }
    }
}
impl<'tcx> Arena<'tcx> {
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    pub fn alloc<T: ArenaAllocatable<'tcx, C>, C>(&'tcx self, value: T)
        -> &mut T {
        value.allocate_on(self)
    }
    #[inline]
    #[allow(clippy :: mut_from_ref)]
    pub fn alloc_slice<T: ::std::marker::Copy>(&self, value: &[T])
        -> &mut [T] {
        if value.is_empty() { return &mut []; }
        self.dropless.alloc_slice(value)
    }
    #[inline]
    pub fn alloc_str(&self, string: &str) -> &str {
        if string.is_empty() { return ""; }
        self.dropless.alloc_str(string)
    }
    #[inline]
    pub fn alloc_os_str(&self, os_str: &::std::ffi::OsStr)
        -> &::std::ffi::OsStr {
        use ::std::ffi::OsStr;
        if os_str.is_empty() { return OsStr::new(""); }
        let bytes = self.dropless.alloc_slice(os_str.as_encoded_bytes());
        unsafe { OsStr::from_encoded_bytes_unchecked(bytes) }
    }
    #[inline]
    pub fn alloc_path(&self, path: &::std::path::Path) -> &::std::path::Path {
        use ::std::path::Path;
        Path::new(self.alloc_os_str(path.as_os_str()))
    }
    #[allow(clippy :: mut_from_ref)]
    pub fn alloc_from_iter<T: ArenaAllocatable<'tcx, C>,
        C>(&'tcx self, iter: impl ::std::iter::IntoIterator<Item = T>)
        -> &mut [T] {
        T::allocate_from_iter(self, iter)
    }
    #[allow(clippy :: mut_from_ref)]
    pub fn alloc_index_slice_from_iter<I, T,
        C>(&'tcx self, iter: impl ::std::iter::IntoIterator<Item = T>)
        -> &mut ::rustc_index::IndexSlice<I, T> where I: ::rustc_index::Idx,
        T: ArenaAllocatable<'tcx, C> {
        ::rustc_index::IndexSlice::from_raw_mut(self.alloc_from_iter(iter))
    }
}rustc_arena::declare_arena! {
16    layout: rustc_abi::LayoutData<rustc_abi::FieldIdx, rustc_abi::VariantIdx>,
17    proxy_coroutine_layout: rustc_middle::mir::CoroutineLayout<'tcx>,
18    fn_abi: rustc_target::callconv::FnAbi<'tcx, Ty<'tcx>>,
19    adt_def: rustc_middle::ty::AdtDefData,
20    steal_thir: rustc_data_structures::steal::Steal<rustc_middle::thir::Thir<'tcx>>,
21    steal_mir: rustc_data_structures::steal::Steal<rustc_middle::mir::Body<'tcx>>,
22    mir: rustc_middle::mir::Body<'tcx>,
23    steal_promoted:
24        rustc_data_structures::steal::Steal<
25            rustc_index::IndexVec<
26                rustc_middle::mir::Promoted,
27                rustc_middle::mir::Body<'tcx>
28            >
29        >,
30    promoted:
31        rustc_index::IndexVec<
32            rustc_middle::mir::Promoted,
33            rustc_middle::mir::Body<'tcx>
34        >,
35    typeck_results: rustc_middle::ty::TypeckResults<'tcx>,
36    borrowck_result:
37        rustc_data_structures::fx::FxIndexMap<
38            rustc_hir::def_id::LocalDefId,
39            rustc_middle::ty::DefinitionSiteHiddenType<'tcx>,
40        >,
41    resolver:
42        rustc_data_structures::steal::Steal<
43            rustc_middle::middle::resolve::ResolverAstLowering<'tcx>
44        >,
45    index_ast:
46        rustc_data_structures::steal::Steal<(
47            std::sync::Arc<rustc_middle::middle::resolve::ResolverAstLowering<'tcx>>,
48            rustc_middle::middle::resolve::AstOwner
49        )>,
50    crate_alone: rustc_data_structures::steal::Steal<rustc_ast::Crate>,
51    crate_for_resolver: rustc_data_structures::steal::Steal<(rustc_ast::Crate, rustc_ast::AttrVec)>,
52    resolutions: rustc_middle::middle::resolve::ResolverGlobalCtxt,
53    const_allocs: rustc_middle::mir::interpret::Allocation,
54    region_scope_tree: rustc_middle::middle::region::ScopeTree,
55    // Required for the incremental on-disk cache
56    mir_keys: rustc_hir::def_id::DefIdSet,
57    dropck_outlives:
58        rustc_middle::infer::canonical::Canonical<'tcx,
59            rustc_middle::infer::canonical::QueryResponse<'tcx,
60                rustc_middle::traits::query::DropckOutlivesResult<'tcx>
61            >
62        >,
63    normalize_canonicalized_projection:
64        rustc_middle::infer::canonical::Canonical<'tcx,
65            rustc_middle::infer::canonical::QueryResponse<'tcx,
66                rustc_middle::traits::query::NormalizationResult<'tcx>
67            >
68        >,
69    implied_outlives_bounds:
70        rustc_middle::infer::canonical::Canonical<'tcx,
71            rustc_middle::infer::canonical::QueryResponse<'tcx,
72                Vec<rustc_middle::traits::query::OutlivesBound<'tcx>>
73            >
74        >,
75    mir_borrowck_implied_outlives_bounds:
76        rustc_middle::infer::canonical::Canonical<'tcx,
77            rustc_middle::infer::canonical::QueryResponse<'tcx,
78                rustc_middle::traits::query::MirBorrowckImpliedOutlivesBounds<'tcx>
79            >
80        >,
81    dtorck_constraint: rustc_middle::traits::query::DropckConstraint<'tcx>,
82    candidate_step: rustc_middle::traits::query::CandidateStep<'tcx>,
83    autoderef_bad_ty: rustc_middle::traits::query::MethodAutoderefBadTy<'tcx>,
84    query_region_constraints: rustc_middle::infer::canonical::QueryRegionConstraints<'tcx>,
85    type_op_subtype:
86        rustc_middle::infer::canonical::Canonical<'tcx,
87            rustc_middle::infer::canonical::QueryResponse<'tcx, ()>
88        >,
89    type_op_normalize_poly_fn_sig:
90        rustc_middle::infer::canonical::Canonical<'tcx,
91            rustc_middle::infer::canonical::QueryResponse<'tcx, rustc_middle::ty::PolyFnSig<'tcx>>
92        >,
93    type_op_normalize_fn_sig:
94        rustc_middle::infer::canonical::Canonical<'tcx,
95            rustc_middle::infer::canonical::QueryResponse<'tcx, rustc_middle::ty::FnSig<'tcx>>
96        >,
97    type_op_normalize_clause:
98        rustc_middle::infer::canonical::Canonical<'tcx,
99            rustc_middle::infer::canonical::QueryResponse<'tcx, rustc_middle::ty::Clause<'tcx>>
100        >,
101    type_op_normalize_ty:
102        rustc_middle::infer::canonical::Canonical<'tcx,
103            rustc_middle::infer::canonical::QueryResponse<'tcx, Ty<'tcx>>
104        >,
105    inspect_probe: rustc_middle::traits::solve::inspect::Probe<TyCtxt<'tcx>>,
106    effective_visibilities: rustc_middle::middle::privacy::EffectiveVisibilities,
107    upvars_mentioned: rustc_data_structures::fx::FxIndexMap<rustc_hir::HirId, rustc_hir::Upvar>,
108    dyn_compatibility_violations: rustc_middle::traits::DynCompatibilityViolation,
109    codegen_unit: rustc_middle::mono::CodegenUnit<'tcx>,
110    attribute: rustc_attr_ir::Attribute,
111    name_set: rustc_data_structures::unord::UnordSet<rustc_span::Symbol>,
112    autodiff_item: rustc_attr_ir::AutoDiffItem,
113    ordered_name_set: rustc_data_structures::fx::FxIndexSet<rustc_span::Symbol>,
114    stable_order_of_exportable_impls:
115        rustc_data_structures::fx::FxIndexMap<rustc_hir::def_id::DefId, usize>,
116
117    // Note that this deliberately duplicates items in the `rustc_hir::arena`,
118    // since we need to allocate this type on both the `rustc_hir` arena
119    // (during lowering) and the `rustc_middle` arena (for decoding MIR)
120    asm_template: rustc_ast::InlineAsmTemplatePiece,
121    used_trait_imports: rustc_data_structures::unord::UnordSet<rustc_hir::def_id::LocalDefId>,
122    is_late_bound_map: rustc_data_structures::fx::FxIndexSet<rustc_hir::ItemLocalId>,
123    impl_source: rustc_middle::traits::ImplSource<'tcx, ()>,
124
125    dep_kind_vtable: rustc_middle::dep_graph::DepKindVTable<'tcx>,
126
127    trait_impl_trait_tys:
128        rustc_data_structures::unord::UnordMap<
129            rustc_hir::def_id::DefId,
130            rustc_middle::ty::EarlyBinder<'tcx, Ty<'tcx>>
131        >,
132    external_constraints: rustc_middle::traits::solve::ExternalConstraintsData<TyCtxt<'tcx>>,
133    doc_link_resolutions: rustc_middle::middle::resolve::DocLinkResMap,
134    stripped_cfg_items: rustc_attr_ir::StrippedCfgItem,
135    mod_child: rustc_middle::middle::resolve::ModChild,
136    features: rustc_feature::Features,
137    specialization_graph: rustc_middle::traits::specialization_graph::Graph,
138    crate_inherent_impls: rustc_middle::ty::CrateInherentImpls,
139    hir_owner_nodes: rustc_hir::OwnerNodes<'tcx>,
140    token_stream: rustc_ast::tokenstream::TokenStream,
141    parenting: rustc_hir::def_id::LocalDefIdMap<rustc_hir::ItemLocalId>,
142    trait_candidates: rustc_hir::ItemLocalMap<&'tcx [rustc_hir::TraitCandidate<'tcx>]>,
143    delayed_lints: rustc_data_structures::steal::Steal<rustc_hir::lints::DelayedLints>,
144}
145
146#[inline]
147fn decode_arena_allocatable<'tcx, D, C, T>(decoder: &mut D) -> &'tcx T
148where
149    D: TyDecoder<'tcx>,
150    T: ArenaAllocatable<'tcx, C> + Decodable<D>,
151{
152    let value: T = Decodable::decode(decoder);
153    decoder.interner().arena.alloc(value)
154}
155
156#[inline]
157fn decode_arena_allocatable_slice<'tcx, D, C, T>(decoder: &mut D) -> &'tcx [T]
158where
159    D: TyDecoder<'tcx>,
160    T: ArenaAllocatable<'tcx, C> + Decodable<D>,
161{
162    // The decoder for slices must match the decoder for `Vec<T>`,
163    // which is a `usize` length followed by that many `T`.
164    let len = decoder.read_usize();
165    decoder.interner().arena.alloc_from_iter((0..len).map(|_| T::decode(decoder)))
166}
167
168macro_rules! impl_ref_decodable_into_arena {
169    (
170        $(
171            $ty:ty,
172        )*
173    ) => {
174        $(
175            impl<'tcx> RefDecodable<'tcx> for $ty {
176                #[inline]
177                fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
178                    decode_arena_allocatable(decoder)
179                }
180            }
181
182            impl<'tcx> RefDecodable<'tcx> for [$ty] {
183                #[inline]
184                fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
185                    decode_arena_allocatable_slice(decoder)
186                }
187            }
188        )*
189    }
190}
191
192// For each of these types, implements `RefDecodable` for `T` (and `[T]`) by
193// decoding to `T` and then moving the value or values into an arena allocation.
194//
195// Types in this list must be `ArenaAllocatable`, either because they are `Copy`
196// or because they are listed in the `declare_arena!` invocation.
197//
198// Types in this list must also implement `Decodable<D>` for all `D: TyDecoder<'tcx>`.
199impl<'tcx> RefDecodable<'tcx> for
    (rustc_middle::middle::exported_symbols::ExportedSymbol<'tcx>,
    rustc_middle::middle::exported_symbols::SymbolExportInfo) {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for
    [(rustc_middle::middle::exported_symbols::ExportedSymbol<'tcx>,
    rustc_middle::middle::exported_symbols::SymbolExportInfo)] {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable_slice(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for (ty::Clause<'tcx>, Span) {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for [(ty::Clause<'tcx>, Span)] {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable_slice(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for (ty::PolyTraitRef<'tcx>, Span) {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for [(ty::PolyTraitRef<'tcx>, Span)] {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable_slice(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for Spanned<MonoItem<'tcx>> {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for [Spanned<MonoItem<'tcx>>] {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable_slice(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for rustc_ast::InlineAsmTemplatePiece {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for [rustc_ast::InlineAsmTemplatePiece] {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable_slice(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for rustc_ast::tokenstream::TokenStream {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for [rustc_ast::tokenstream::TokenStream] {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable_slice(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for rustc_attr_ir::Attribute {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for [rustc_attr_ir::Attribute] {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable_slice(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for
    rustc_data_structures::unord::UnordMap<rustc_span::def_id::DefId,
    rustc_middle::ty::EarlyBinder<'tcx, Ty<'tcx>>> {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for
    [rustc_data_structures::unord::UnordMap<rustc_span::def_id::DefId,
    rustc_middle::ty::EarlyBinder<'tcx, Ty<'tcx>>>] {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable_slice(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for
    rustc_data_structures::unord::UnordSet<rustc_span::def_id::LocalDefId> {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for
    [rustc_data_structures::unord::UnordSet<rustc_span::def_id::LocalDefId>] {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable_slice(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for
    rustc_index::IndexVec<rustc_middle::mir::Promoted,
    rustc_middle::mir::Body<'tcx>> {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for
    [rustc_index::IndexVec<rustc_middle::mir::Promoted,
    rustc_middle::mir::Body<'tcx>>] {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable_slice(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for
    rustc_middle::middle::deduced_param_attrs::DeducedParamAttrs {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for
    [rustc_middle::middle::deduced_param_attrs::DeducedParamAttrs] {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable_slice(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for rustc_middle::mir::Body<'tcx> {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for [rustc_middle::mir::Body<'tcx>] {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable_slice(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for rustc_middle::traits::ImplSource<'tcx, ()> {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for [rustc_middle::traits::ImplSource<'tcx, ()>]
    {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable_slice(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for
    rustc_middle::traits::specialization_graph::Graph {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for
    [rustc_middle::traits::specialization_graph::Graph] {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable_slice(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for rustc_middle::ty::TypeckResults<'tcx> {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for [rustc_middle::ty::TypeckResults<'tcx>] {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable_slice(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for rustc_middle::ty::Variance {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for [rustc_middle::ty::Variance] {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable_slice(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for rustc_span::Ident {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for [rustc_span::Ident] {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable_slice(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for rustc_span::Span {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for [rustc_span::Span] {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable_slice(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for rustc_span::def_id::DefId {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for [rustc_span::def_id::DefId] {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable_slice(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for rustc_span::def_id::LocalDefId {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable(decoder)
    }
}
impl<'tcx> RefDecodable<'tcx> for [rustc_span::def_id::LocalDefId] {
    #[inline]
    fn decode(decoder: &mut impl TyDecoder<'tcx>) -> &'tcx Self {
        decode_arena_allocatable_slice(decoder)
    }
}impl_ref_decodable_into_arena! {
200    // tidy-alphabetical-start
201    (rustc_middle::middle::exported_symbols::ExportedSymbol<'tcx>, rustc_middle::middle::exported_symbols::SymbolExportInfo),
202    (ty::Clause<'tcx>, Span),
203    (ty::PolyTraitRef<'tcx>, Span),
204    Spanned<MonoItem<'tcx>>,
205    rustc_ast::InlineAsmTemplatePiece,
206    rustc_ast::tokenstream::TokenStream,
207    rustc_attr_ir::Attribute,
208    rustc_data_structures::unord::UnordMap<rustc_span::def_id::DefId, rustc_middle::ty::EarlyBinder<'tcx, Ty<'tcx>>>,
209    rustc_data_structures::unord::UnordSet<rustc_span::def_id::LocalDefId>,
210    rustc_index::IndexVec<rustc_middle::mir::Promoted, rustc_middle::mir::Body<'tcx>>,
211    rustc_middle::middle::deduced_param_attrs::DeducedParamAttrs,
212    rustc_middle::mir::Body<'tcx>,
213    rustc_middle::traits::ImplSource<'tcx, ()>,
214    rustc_middle::traits::specialization_graph::Graph,
215    rustc_middle::ty::TypeckResults<'tcx>,
216    rustc_middle::ty::Variance,
217    rustc_span::Ident,
218    rustc_span::Span,
219    rustc_span::def_id::DefId,
220    rustc_span::def_id::LocalDefId,
221    // tidy-alphabetical-end
222}