2019-02-15 19:43:56 -06:00
|
|
|
// FIXME: validation disabled because it checks these references too eagerly.
|
2018-10-11 04:24:22 -05:00
|
|
|
// compile-flags: -Zmiri-disable-validation
|
|
|
|
|
2017-07-25 19:02:57 -05:00
|
|
|
fn main() {
|
|
|
|
let x = 2usize as *const u32;
|
2019-02-15 19:43:56 -06:00
|
|
|
// This is not aligned, but we immediately cast it to a raw ptr so that must be ok.
|
2017-07-25 19:02:57 -05:00
|
|
|
let _y = unsafe { &*x as *const u32 };
|
|
|
|
|
|
|
|
let x = 0usize as *const u32;
|
2019-02-15 19:43:56 -06:00
|
|
|
// This is NULL, but we immediately cast it to a raw ptr so that must be ok.
|
2017-07-25 19:02:57 -05:00
|
|
|
let _y = unsafe { &*x as *const u32 };
|
|
|
|
}
|