-
Notifications
You must be signed in to change notification settings - Fork 392
Open
Labels
C-spec-questionCategory: it is unclear what the intended behavior of Miri for this case isCategory: it is unclear what the intended behavior of Miri for this case is
Description
I tried this code:
#![feature(sync_unsafe_cell)]
use std::cell::SyncUnsafeCell;
static PARAM: SyncUnsafeCell<i64> = SyncUnsafeCell::new(0);
static BAD: &'static i64 = unsafe { &*PARAM.get() };
fn main() {
println!("{BAD}");
unsafe { *PARAM.get() = 42 };
println!("{BAD}");
}
And expected miri
to complain about UB. But it doesn't (I also tried tree-borrows & strict-provenance).
(feel free to improve the issue title)
Metadata
Metadata
Assignees
Labels
C-spec-questionCategory: it is unclear what the intended behavior of Miri for this case isCategory: it is unclear what the intended behavior of Miri for this case is