]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/fail/validity/dangling_ref1.rs
Auto merge of #103020 - lyming2007:issue-102598-fix, r=jackh726
[rust.git] / src / tools / miri / tests / fail / validity / dangling_ref1.rs
1 // Make sure we catch this even without Stacked Borrows
2 //@compile-flags: -Zmiri-disable-stacked-borrows
3 use std::mem;
4
5 fn main() {
6     let _x: &i32 = unsafe { mem::transmute(16usize) }; //~ ERROR: encountered a dangling reference (address 0x10 is unallocated)
7 }