Skip to content

Commit a5b8193

Browse files
committed
Store adt_async_destructor in metadata
1 parent e77315f commit a5b8193

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

Diff for: compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,7 @@ provide! { tcx, def_id, other, cdata,
331331
visibility => { cdata.get_visibility(def_id.index) }
332332
adt_def => { cdata.get_adt_def(def_id.index, tcx) }
333333
adt_destructor => { table }
334-
adt_async_destructor => {
335-
let _ = cdata;
336-
tcx.calculate_async_dtor(def_id, |_,_| Ok(()))
337-
}
334+
adt_async_destructor => { table }
338335
associated_item_def_ids => {
339336
tcx.arena.alloc_from_iter(cdata.get_associated_item_or_field_def_ids(def_id.index))
340337
}

Diff for: compiler/rustc_metadata/src/rmeta/encoder.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1637,6 +1637,10 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
16371637
if let Some(destructor) = tcx.adt_destructor(local_def_id) {
16381638
record!(self.tables.adt_destructor[def_id] <- destructor);
16391639
}
1640+
1641+
if let Some(destructor) = tcx.adt_async_destructor(local_def_id) {
1642+
record!(self.tables.adt_async_destructor[def_id] <- destructor);
1643+
}
16401644
}
16411645

16421646
#[instrument(level = "debug", skip(self))]

Diff for: compiler/rustc_metadata/src/rmeta/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ define_tables! {
447447
coroutine_kind: Table<DefIndex, hir::CoroutineKind>,
448448
coroutine_for_closure: Table<DefIndex, RawDefId>,
449449
adt_destructor: Table<DefIndex, LazyValue<ty::Destructor>>,
450+
adt_async_destructor: Table<DefIndex, LazyValue<ty::AsyncDestructor>>,
450451
coroutine_by_move_body_def_id: Table<DefIndex, RawDefId>,
451452
eval_static_initializer: Table<DefIndex, LazyValue<mir::interpret::ConstAllocation<'static>>>,
452453
trait_def: Table<DefIndex, LazyValue<ty::TraitDef>>,

Diff for: compiler/rustc_middle/src/ty/parameterized.rs

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ trivially_parameterized_over_tcx! {
6565
crate::middle::lib_features::FeatureStability,
6666
crate::middle::resolve_bound_vars::ObjectLifetimeDefault,
6767
crate::mir::ConstQualifs,
68+
ty::AsyncDestructor,
6869
ty::AssocItemContainer,
6970
ty::Asyncness,
7071
ty::DeducedParamAttrs,

0 commit comments

Comments
 (0)