1 // A callee may not read the destination of our `&mut` without
4 #[rustfmt::skip] // rustfmt bug: https://github.com/rust-lang/rustfmt/issues/5391
7 let xraw = &mut x as *mut _;
8 let xref = unsafe { &mut *xraw }; // derived from raw, so using raw is still ok...
10 let _val = *xref; // ...but any use of raw will invalidate our ref.
11 //~^ ERROR: /read access .* tag does not exist in the borrow stack/
14 fn callee(xraw: *mut i32) {
15 let _val = unsafe { *xraw };