Skip to content

Commit 5a801c0

Browse files
committed
adjust comment
1 parent a87e952 commit 5a801c0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/stacked_borrows.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -509,10 +509,8 @@ impl<'a, 'mir, 'tcx> EvalContextExt<'tcx> for MiriEvalContext<'a, 'mir, 'tcx> {
509509
// Expected combinations. Nothing to do.
510510
}
511511
(Some(MutMutable), Borrow::Shr(None)) => {
512-
// Raw transmuted to mut ref. Keep this as raw access.
513-
// We cannot reborrow here; there might be a raw in `&(*var).1` where
514-
// `var` is an `&mut`. The other field of the struct might be already frozen,
515-
// also using `var`, and that would be okay.
512+
// Raw transmuted to mut ref. This is something real unsafe code does.
513+
// We cannot reborrow here because we do not want to mutate state on a deref.
516514
}
517515
(Some(MutImmutable), Borrow::Uniq(_)) => {
518516
// A mut got transmuted to shr. Can happen even from compiler transformations:

0 commit comments

Comments
 (0)