adt_def => { cdata.get_adt_def(def_id.index, tcx) }
adt_destructor => {
let _ = cdata;
- tcx.calculate_dtor(def_id, |_,_| Ok(()))
+ tcx.calculate_dtor(def_id, &mut |_,_| Ok(()))
}
variances_of => { tcx.arena.alloc_from_iter(cdata.get_item_variances(def_id.index)) }
associated_item_def_ids => {
pub fn calculate_dtor(
self,
adt_did: DefId,
- validate: impl Fn(Self, DefId) -> Result<(), ErrorReported>,
+ validate: &mut dyn FnMut(Self, DefId) -> Result<(), ErrorReported>,
) -> Option<ty::Destructor> {
let drop_trait = self.lang_items().drop_trait()?;
self.ensure().coherent_trait(drop_trait);
//
// #[const_mutation_allowed]
// pub const LOG: Log = Log { msg: "" };
- match self.tcx.calculate_dtor(def_id, |_, _| Ok(())) {
+ match self.tcx.calculate_dtor(def_id, &mut |_, _| Ok(())) {
Some(_) => None,
None => Some(def_id),
}
}
fn adt_destructor(tcx: TyCtxt<'_>, def_id: DefId) -> Option<ty::Destructor> {
- tcx.calculate_dtor(def_id, dropck::check_drop_impl)
+ tcx.calculate_dtor(def_id, &mut dropck::check_drop_impl)
}
/// If this `DefId` is a "primary tables entry", returns