Skip to content

Commit

Permalink
Make sure to enforce ~const DerefMut on mutability fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Oct 29, 2024
1 parent a95444c commit 7612b8d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_hir_typeck/src/place_op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
if let ty::Ref(region, _, mutbl) = *method.sig.output().kind() {
*deref = OverloadedDeref { region, 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
Expand Down

0 comments on commit 7612b8d

Please sign in to comment.