Skip to content

Commit 721787c

Browse files
Make sure to enforce ~const DerefMut on mutability fixup
1 parent 1aae8b9 commit 721787c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler/rustc_hir_typeck/src/place_op.rs

+1
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
296296
);
297297
};
298298
*deref = OverloadedDeref { mutbl, span: deref.span };
299+
self.enforce_context_effects(expr.span, method.def_id, method.args);
299300
// If this is a union field, also throw an error for `DerefMut` of `ManuallyDrop` (see RFC 2514).
300301
// This helps avoid accidental drops.
301302
if inside_union

0 commit comments

Comments
 (0)