Skip to content

Commit cd45acc

Browse files
authored
Revert "Monomorphize calculate_dtor instead of using function pointers"
1 parent 8f0fa9d commit cd45acc

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ provide! { <'tcx> tcx, def_id, other, cdata,
9494
adt_def => { cdata.get_adt_def(def_id.index, tcx) }
9595
adt_destructor => {
9696
let _ = cdata;
97-
tcx.calculate_dtor(def_id, |_,_| Ok(()))
97+
tcx.calculate_dtor(def_id, &mut |_,_| Ok(()))
9898
}
9999
variances_of => { tcx.arena.alloc_from_iter(cdata.get_item_variances(def_id.index)) }
100100
associated_item_def_ids => {

compiler/rustc_middle/src/ty/util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ impl<'tcx> TyCtxt<'tcx> {
341341
pub fn calculate_dtor(
342342
self,
343343
adt_did: DefId,
344-
validate: impl Fn(Self, DefId) -> Result<(), ErrorReported>,
344+
validate: &mut dyn FnMut(Self, DefId) -> Result<(), ErrorReported>,
345345
) -> Option<ty::Destructor> {
346346
let drop_trait = self.lang_items().drop_trait()?;
347347
self.ensure().coherent_trait(drop_trait);

compiler/rustc_mir/src/transform/check_const_item_mutation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl<'a, 'tcx> ConstMutationChecker<'a, 'tcx> {
5353
//
5454
// #[const_mutation_allowed]
5555
// pub const LOG: Log = Log { msg: "" };
56-
match self.tcx.calculate_dtor(def_id, |_, _| Ok(())) {
56+
match self.tcx.calculate_dtor(def_id, &mut |_, _| Ok(())) {
5757
Some(_) => None,
5858
None => Some(def_id),
5959
}

compiler/rustc_typeck/src/check/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ pub fn provide(providers: &mut Providers) {
265265
}
266266

267267
fn adt_destructor(tcx: TyCtxt<'_>, def_id: DefId) -> Option<ty::Destructor> {
268-
tcx.calculate_dtor(def_id, dropck::check_drop_impl)
268+
tcx.calculate_dtor(def_id, &mut dropck::check_drop_impl)
269269
}
270270

271271
/// If this `DefId` is a "primary tables entry", returns

0 commit comments

Comments
 (0)