1 // This is a copy of illegal_read1.rs, but with #[track_caller] on the test.
2 // This test only checks that our diagnostics do not display the contents of callee.
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/
15 fn callee(xraw: *mut i32) {
16 let _val = unsafe { *xraw };