about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc_mir/transform/check_consts/qualifs.rs18
-rw-r--r--src/librustc_mir/transform/check_consts/validation.rs2
2 files changed, 10 insertions, 10 deletions
diff --git a/src/librustc_mir/transform/check_consts/qualifs.rs b/src/librustc_mir/transform/check_consts/qualifs.rs
index 2c0c0cbbadd..e509e8267cc 100644
--- a/src/librustc_mir/transform/check_consts/qualifs.rs
+++ b/src/librustc_mir/transform/check_consts/qualifs.rs
@@ -34,7 +34,7 @@ pub trait Qualif {
 
     fn in_projection_structurally(
         cx: &ConstCx<'_, 'tcx>,
-        per_local: &impl Fn(Local) -> bool,
+        per_local: &mut impl FnMut(Local) -> bool,
         place: PlaceRef<'_, 'tcx>,
     ) -> bool {
         if let [proj_base @ .., elem] = place.projection {
@@ -66,7 +66,7 @@ pub trait Qualif {
 
     fn in_projection(
         cx: &ConstCx<'_, 'tcx>,
-        per_local: &impl Fn(Local) -> bool,
+        per_local: &mut impl FnMut(Local) -> bool,
         place: PlaceRef<'_, 'tcx>,
     ) -> bool {
         Self::in_projection_structurally(cx, per_local, place)
@@ -74,7 +74,7 @@ pub trait Qualif {
 
     fn in_place(
         cx: &ConstCx<'_, 'tcx>,
-        per_local: &impl Fn(Local) -> bool,
+        per_local: &mut impl FnMut(Local) -> bool,
         place: PlaceRef<'_, 'tcx>,
     ) -> bool {
         match place {
@@ -85,7 +85,7 @@ pub trait Qualif {
 
     fn in_operand(
         cx: &ConstCx<'_, 'tcx>,
-        per_local: &impl Fn(Local) -> bool,
+        per_local: &mut impl FnMut(Local) -> bool,
         operand: &Operand<'tcx>,
     ) -> bool {
         match *operand {
@@ -126,7 +126,7 @@ pub trait Qualif {
 
     fn in_rvalue_structurally(
         cx: &ConstCx<'_, 'tcx>,
-        per_local: &impl Fn(Local) -> bool,
+        per_local: &mut impl FnMut(Local) -> bool,
         rvalue: &Rvalue<'tcx>,
     ) -> bool {
         match *rvalue {
@@ -170,7 +170,7 @@ pub trait Qualif {
 
     fn in_rvalue(
         cx: &ConstCx<'_, 'tcx>,
-        per_local: &impl Fn(Local) -> bool,
+        per_local: &mut impl FnMut(Local) -> bool,
         rvalue: &Rvalue<'tcx>,
     ) -> bool {
         Self::in_rvalue_structurally(cx, per_local, rvalue)
@@ -178,7 +178,7 @@ pub trait Qualif {
 
     fn in_call(
         cx: &ConstCx<'_, 'tcx>,
-        _per_local: &impl Fn(Local) -> bool,
+        _per_local: &mut impl FnMut(Local) -> bool,
         _callee: &Operand<'tcx>,
         _args: &[Operand<'tcx>],
         return_ty: Ty<'tcx>,
@@ -208,7 +208,7 @@ impl Qualif for HasMutInterior {
 
     fn in_rvalue(
         cx: &ConstCx<'_, 'tcx>,
-        per_local: &impl Fn(Local) -> bool,
+        per_local: &mut impl FnMut(Local) -> bool,
         rvalue: &Rvalue<'tcx>,
     ) -> bool {
         match *rvalue {
@@ -249,7 +249,7 @@ impl Qualif for NeedsDrop {
 
     fn in_rvalue(
         cx: &ConstCx<'_, 'tcx>,
-        per_local: &impl Fn(Local) -> bool,
+        per_local: &mut impl FnMut(Local) -> bool,
         rvalue: &Rvalue<'tcx>,
     ) -> bool {
         if let Rvalue::Aggregate(ref kind, _) = *rvalue {
diff --git a/src/librustc_mir/transform/check_consts/validation.rs b/src/librustc_mir/transform/check_consts/validation.rs
index 6f109a060df..4dac0d09413 100644
--- a/src/librustc_mir/transform/check_consts/validation.rs
+++ b/src/librustc_mir/transform/check_consts/validation.rs
@@ -253,7 +253,7 @@ impl Validator<'a, 'mir, 'tcx> {
 
         let borrowed_place_has_mut_interior = HasMutInterior::in_place(
             &self.item,
-            &|local| self.qualifs.has_mut_interior_eager_seek(local),
+            &mut |local| self.qualifs.has_mut_interior_eager_seek(local),
             place.as_ref(),
         );