2019-07-27 04:03:12 -05:00
|
|
|
// This should fail even without validation.
|
2022-07-08 11:08:32 -05:00
|
|
|
//@compile-flags: -Zmiri-disable-validation -Zmiri-permissive-provenance
|
2019-07-27 04:03:12 -05:00
|
|
|
|
|
|
|
fn main() {
|
2020-04-11 02:30:13 -05:00
|
|
|
let x = 16usize as *const u32;
|
2022-07-11 06:44:55 -05:00
|
|
|
let _y = unsafe { &*x as *const u32 }; //~ ERROR: is a dangling pointer
|
2019-07-27 04:03:12 -05:00
|
|
|
}
|