Skip to content

Commit cb691b7

Browse files
committed
comment on mut-to-shr transmutes
1 parent 8ac5d98 commit cb691b7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/stacked_borrows.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,8 @@ impl<'a, 'mir, 'tcx> EvalContextExt<'tcx> for super::MiriEvalContext<'a, 'mir, '
462462
// also using `var`, and that would be okay.
463463
}
464464
(UsageKind::Read, Borrow::Mut(Mut::Uniq(_))) => {
465-
// A mut got transmuted to shr. The mut borrow must be reactivatable.
465+
// A mut got transmuted to shr. Can happen even from compiler transformations:
466+
// `&*x` gets optimized to `x` even when `x` is a `&mut`.
466467
}
467468
(UsageKind::Write, Borrow::Frz(_)) => {
468469
// This is just invalid.

0 commit comments

Comments
 (0)