We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e057d48 commit 9317d32Copy full SHA for 9317d32
tests/compile-fail/ptr_int_guess.rs
@@ -6,6 +6,7 @@ fn main() {
6
7
// TODO: switch this to addr() once we intrinsify it
8
let x_usize: usize = unsafe { std::mem::transmute(x_ptr) };
9
+ // Cast back a pointer that did *not* get exposed.
10
let ptr = x_usize as *const i32;
11
assert_eq!(unsafe { *ptr }, 3); //~ ERROR Undefined Behavior: dereferencing pointer failed
12
}
0 commit comments