]> git.lizzy.rs Git - rust.git/commitdiff
Revert calculate_dtor signature change
authorDániel Buga <bugadani@gmail.com>
Fri, 9 Oct 2020 15:18:57 +0000 (17:18 +0200)
committerDániel Buga <bugadani@gmail.com>
Fri, 9 Oct 2020 15:18:57 +0000 (17:18 +0200)
compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs
compiler/rustc_middle/src/ty/util.rs
compiler/rustc_mir/src/transform/check_const_item_mutation.rs
compiler/rustc_typeck/src/check/mod.rs

index 05b8dad3097e413f52c37020e56525c65c06ceec..60705f68681a1d6170a600ff5a05533695f3af7e 100644 (file)
@@ -94,7 +94,7 @@ fn into_args(self) -> (DefId, DefId) {
     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 => {
index 5ac12dfa993661dea69f2be093b6cc07f98f5961..d8ea2f67393b25dfe2436e458cb5971fc7a4076c 100644 (file)
@@ -341,7 +341,7 @@ pub fn struct_lockstep_tails_with_normalize(
     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);
index fb89b36060a28ace819f2ffa1748cbc471a597a0..26993a6b941fbb26a455da0544f04a34a4876461 100644 (file)
@@ -53,7 +53,7 @@ fn is_const_item_without_destructor(&self, local: Local) -> Option<DefId> {
         //
         //     #[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),
         }
index 1cb6ae21a47bbba05072f23fc61d156e1f409922..97172d391ba659a71f4f84e3c2b6a311bd8c3468 100644 (file)
@@ -264,7 +264,7 @@ pub fn provide(providers: &mut Providers) {
 }
 
 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