Make sure to enforce ~const DerefMut on mutability fixup
This commit is contained in:
parent
e03e9abe3c
commit
7bd595d216
1 changed files with 1 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue