Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 1b214a0

Browse files
committed
do not protect SRW items
1 parent b5bc4e1 commit 1b214a0

File tree

3 files changed

+7
-55
lines changed

3 files changed

+7
-55
lines changed

src/stacked_borrows.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,13 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
821821
} else {
822822
Permission::SharedReadWrite
823823
};
824+
let protector = if frozen {
825+
protector
826+
} else {
827+
// We do not protect inside UnsafeCell.
828+
// This fixes https://github.com/rust-lang/rust/issues/55005.
829+
None
830+
};
824831
let item = Item { perm, tag: new_tag, protector };
825832
let mut global = this.machine.stacked_borrows.as_ref().unwrap().borrow_mut();
826833
stacked_borrows.for_each(range, |offset, stack, history| {

tests/fail/stacked_borrows/deallocate_against_barrier2.rs

Lines changed: 0 additions & 17 deletions
This file was deleted.

tests/fail/stacked_borrows/deallocate_against_barrier2.stderr

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)