1 // Test what happens when we read parts of a pointer.
2 // Related to <https://github.com/rust-lang/rust/issues/69488>.
3 fn ptr_partial_read() {
6 let z = &y as *const &i32 as *const u8;
8 // This just strips provenance, but should work fine otherwise.
9 let _val = unsafe { *z };
12 fn transmute_strip_provenance() {
14 let addr = r as *mut _ as usize;
15 let i: usize = unsafe { std::mem::transmute(r) };
21 transmute_strip_provenance();