blob: 53a16ce5d1b4c6c2bb4bac4c647d15619102efac [file] [log] [blame]
//@compile-flags: -Zmiri-strict-provenance
fn main() {
let x = 22;
let ptr = &x as *const _ as *const u8;
let roundtrip = std::ptr::without_provenance::<u8>(ptr as usize);
// Not even offsetting this is allowed.
let _ = unsafe { roundtrip.offset(1) }; //~ERROR: is a dangling pointer
}