1 //@compile-flags: -Zmiri-permissive-provenance
4 // Cast a function pointer such that when returning, the return value gets transmuted
5 // from raw ptr to reference. This is ABI-compatible, so it's not the call that
6 // should fail, but validation should.
11 let g: fn() -> &'static i32 = unsafe { std::mem::transmute(f as fn() -> *const i32) };
14 //~^ ERROR: encountered a null reference