diff options
| author | Michael Goulet <michael@errs.io> | 2024-11-03 04:40:35 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-11-04 04:51:32 +0000 |
| commit | 7bd595d2166c3fd5ae0172b235053bcc3708ccdb (patch) | |
| tree | f73b6236243df555dc5c49e4014f91315cfcc5b5 | |
| parent | e03e9abe3cdccdd1639302f8beafa228d403e076 (diff) | |
| download | rust-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.rs | 1 |
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 |
