]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/fail/stacked_borrows/illegal_write2.rs
Merge commit '4f142aa1058f14f153f8bfd2d82f04ddb9982388' into clippyup
[rust.git] / src / tools / miri / tests / fail / stacked_borrows / illegal_write2.rs
1 fn main() {
2     let target = &mut 42;
3     let target2 = target as *mut _;
4     drop(&mut *target); // reborrow
5     // Now make sure our ref is still the only one.
6     unsafe { *target2 = 13 }; //~ ERROR: /write access .* tag does not exist in the borrow stack/
7     let _val = *target;
8 }