We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 791f464 commit a090edbCopy full SHA for a090edb
tests/run-pass/ref-invalid-ptr.rs
@@ -1,7 +1,9 @@
1
fn main() {
2
let x = 2usize as *const u32;
3
+ // this is not aligned, but we immediately cast it to a raw ptr so that must be okay
4
let _y = unsafe { &*x as *const u32 };
5
6
let x = 0usize as *const u32;
7
+ // this is NULL, but we immediately cast it to a raw ptr so that must be okay
8
9
}
0 commit comments