2017-07-25 19:02:57 -05:00
|
|
|
fn main() {
|
|
|
|
let x = 2usize as *const u32;
|
2018-10-10 02:06:44 -05:00
|
|
|
// this is not aligned, but we immediately cast it to a raw ptr so that must be okay
|
2017-07-25 19:02:57 -05:00
|
|
|
let _y = unsafe { &*x as *const u32 };
|
|
|
|
|
|
|
|
let x = 0usize as *const u32;
|
2018-10-10 02:06:44 -05:00
|
|
|
// this is NULL, but we immediately cast it to a raw ptr so that must be okay
|
2017-07-25 19:02:57 -05:00
|
|
|
let _y = unsafe { &*x as *const u32 };
|
|
|
|
}
|