1 // Make sure that we cannot pass by argument a `&` that got already invalidated.
foo(_: &i32)2 fn foo(_: &i32) {}
3
main()4 fn main() {
5 let x = &mut 42;
6 let xraw = x as *mut _;
7 let xref = unsafe { &*xraw };
8 unsafe { *xraw = 42 }; // unfreeze
9 foo(xref); //~ ERROR borrow stack
10 }
11