about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-11-03 04:40:35 +0000
committerMichael Goulet <michael@errs.io>2024-11-04 04:51:32 +0000
commit7bd595d2166c3fd5ae0172b235053bcc3708ccdb (patch)
treef73b6236243df555dc5c49e4014f91315cfcc5b5
parente03e9abe3cdccdd1639302f8beafa228d403e076 (diff)
downloadrust-7bd595d2166c3fd5ae0172b235053bcc3708ccdb.tar.gz
rust-7bd595d2166c3fd5ae0172b235053bcc3708ccdb.zip
Make sure to enforce ~const DerefMut on mutability fixup
-rw-r--r--compiler/rustc_hir_typeck/src/place_op.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_hir_typeck/src/place_op.rs b/compiler/rustc_hir_typeck/src/place_op.rs
index d5c7fe5fff3..3d401cef76f 100644
--- a/compiler/rustc_hir_typeck/src/place_op.rs
+++ b/compiler/rustc_hir_typeck/src/place_op.rs
@@ -296,6 +296,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                             );
                         };
                         *deref = OverloadedDeref { mutbl, span: deref.span };
+                        self.enforce_context_effects(expr.span, method.def_id, method.args);
                         // If this is a union field, also throw an error for `DerefMut` of `ManuallyDrop` (see RFC 2514).
                         // This helps avoid accidental drops.
                         if inside_union