Skip to content

Commit 115e4b2

Browse files
Make sure to enforce ~const DerefMut on mutability
1 parent 97df6fe commit 115e4b2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: compiler/rustc_hir_typeck/src/place_op.rs

+1
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
292292
if let ty::Ref(region, _, mutbl) = *method.sig.output().kind() {
293293
*deref = OverloadedDeref { region, mutbl, span: deref.span };
294294
}
295+
self.enforce_context_effects(expr.span, method.def_id, method.args);
295296
// If this is a union field, also throw an error for `DerefMut` of `ManuallyDrop` (see RFC 2514).
296297
// This helps avoid accidental drops.
297298
if inside_union

0 commit comments

Comments
 (0)