rust/tests/compile-fail/validity/dangling_ref1.rs

6 lines
138 B
Rust
Raw Normal View History

2018-10-19 11:38:23 -05:00
use std::mem;
fn main() {
2019-07-23 16:25:06 -05:00
let _x: &i32 = unsafe { mem::transmute(16usize) }; //~ ERROR dangling reference (not entirely in bounds)
2018-10-19 11:38:23 -05:00
}