Store adt_destructor in metadata

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

View file

@ -330,10 +330,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 => {
let _ = cdata;
tcx.calculate_dtor(def_id, |_,_| Ok(()))
}
adt_destructor => { table }
adt_async_destructor => {
let _ = cdata;
tcx.calculate_async_dtor(def_id, |_,_| Ok(()))

View file

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

View file

@ -446,6 +446,7 @@ define_tables! {
fn_arg_names: Table<DefIndex, LazyArray<Option<Ident>>>,
coroutine_kind: Table<DefIndex, hir::CoroutineKind>,
coroutine_for_closure: Table<DefIndex, RawDefId>,
adt_destructor: Table<DefIndex, LazyValue<ty::Destructor>>,
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

@ -68,6 +68,7 @@ trivially_parameterized_over_tcx! {
ty::AssocItemContainer,
ty::Asyncness,
ty::DeducedParamAttrs,
ty::Destructor,
ty::Generics,
ty::ImplPolarity,
ty::ImplTraitInTraitData,