Skip to content

Commit 7612b8d

Browse files
Make sure to enforce ~const DerefMut on mutability fixup
1 parent a95444c commit 7612b8d

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
@@ -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)