We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 378d9d4 commit af2b42dCopy full SHA for af2b42d
tests/compile-fail/ptr_eq_integer.rs
@@ -1,8 +1,6 @@
1
-use std::mem;
2
-
3
fn main() {
4
let b = Box::new(0);
5
let x = &*b as *const i32;
6
// We cannot compare this with a non-NULL integer. After all, these *could* be equal (with the right base address).
7
- assert!(x != mem::align_of::<i32>() as *const i32); //~ ERROR invalid arithmetic on pointers
+ assert!(x != 64 as *const i32); //~ ERROR invalid arithmetic on pointers
8
}
0 commit comments