Make sure to enforce ~const DerefMut on mutability fixup
This commit is contained in:
parent
e03e9abe3c
commit
7bd595d216
@ -296,6 +296,7 @@ pub(crate) fn convert_place_derefs_to_mutable(&self, expr: &hir::Expr<'_>) {
|
||||
);
|
||||
};
|
||||
*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…
Reference in New Issue
Block a user