]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/fail/stacked_borrows/illegal_write1.rs
Rollup merge of #105459 - jyn514:proc-macro-default, r=Mark-Simulacrum
[rust.git] / src / tools / miri / tests / fail / stacked_borrows / illegal_write1.rs
1 fn main() {
2     let target = Box::new(42); // has an implicit raw
3     let xref = &*target;
4     {
5         let x: *mut u32 = xref as *const _ as *mut _;
6         unsafe { *x = 42 }; //~ ERROR: /write access .* tag only grants SharedReadOnly permission/
7     }
8     let _x = *xref;
9 }