1
Fork 0

Store adt_async_destructor in metadata

This commit is contained in:
Oli Scherer 2025-03-27 12:46:04 +00:00
parent 23f1fb58f2
commit 2b1c416da7
4 changed files with 7 additions and 4 deletions

View file

@ -331,10 +331,7 @@ provide! { tcx, def_id, other, cdata,
visibility => { cdata.get_visibility(def_id.index) }
adt_def => { cdata.get_adt_def(def_id.index, tcx) }
adt_destructor => { table }
adt_async_destructor => {
let _ = cdata;
tcx.calculate_async_dtor(def_id, |_,_| Ok(()))
}
adt_async_destructor => { table }
associated_item_def_ids => {
tcx.arena.alloc_from_iter(cdata.get_associated_item_or_field_def_ids(def_id.index))
}

View file

@ -1637,6 +1637,10 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
if let Some(destructor) = tcx.adt_destructor(local_def_id) {
record!(self.tables.adt_destructor[def_id] <- destructor);
}
if let Some(destructor) = tcx.adt_async_destructor(local_def_id) {
record!(self.tables.adt_async_destructor[def_id] <- destructor);
}
}
#[instrument(level = "debug", skip(self))]

View file

@ -447,6 +447,7 @@ define_tables! {
coroutine_kind: Table<DefIndex, hir::CoroutineKind>,
coroutine_for_closure: Table<DefIndex, RawDefId>,
adt_destructor: Table<DefIndex, LazyValue<ty::Destructor>>,
adt_async_destructor: Table<DefIndex, LazyValue<ty::AsyncDestructor>>,
coroutine_by_move_body_def_id: Table<DefIndex, RawDefId>,
eval_static_initializer: Table<DefIndex, LazyValue<mir::interpret::ConstAllocation<'static>>>,
trait_def: Table<DefIndex, LazyValue<ty::TraitDef>>,

View file

@ -65,6 +65,7 @@ trivially_parameterized_over_tcx! {
crate::middle::lib_features::FeatureStability,
crate::middle::resolve_bound_vars::ObjectLifetimeDefault,
crate::mir::ConstQualifs,
ty::AsyncDestructor,
ty::AssocItemContainer,
ty::Asyncness,
ty::DeducedParamAttrs,