2018-10-19 18:38:23 +02:00
|
|
|
use std::mem;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let val = 14;
|
|
|
|
let ptr = (&val as *const i32).wrapping_offset(1);
|
2019-07-16 18:39:18 +02:00
|
|
|
let _x: &i32 = unsafe { mem::transmute(ptr) }; //~ ERROR dangling reference (not entirely in bounds)
|
2018-10-19 18:38:23 +02:00
|
|
|
}
|