]> git.proxmox.com Git - rustc.git/blame - src/tools/miri/tests/compile-fail/pointer_byte_read_1.rs
New upstream version 1.23.0+dfsg1
[rustc.git] / src / tools / miri / tests / compile-fail / pointer_byte_read_1.rs
CommitLineData
ea8adc8c
XL
1fn main() {
2 let x = 13;
3 let y = &x;
4 let z = &y as *const &i32 as *const usize;
5 let ptr_bytes = unsafe { *z }; // the actual deref is fine, because we read the entire pointer at once
6 let _ = ptr_bytes % 432; //~ ERROR: tried to access part of a pointer value as raw bytes
7}