explain a test
This commit is contained in:
parent
791f464ea0
commit
a090edbc03
1 changed files with 2 additions and 0 deletions
|
|
@ -1,7 +1,9 @@
|
|||
fn main() {
|
||||
let x = 2usize as *const u32;
|
||||
// this is not aligned, but we immediately cast it to a raw ptr so that must be okay
|
||||
let _y = unsafe { &*x as *const u32 };
|
||||
|
||||
let x = 0usize as *const u32;
|
||||
// this is NULL, but we immediately cast it to a raw ptr so that must be okay
|
||||
let _y = unsafe { &*x as *const u32 };
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue