]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/fail/intrinsics/ptr_offset_int_plus_ptr.rs
Rollup merge of #102137 - b-naber:lazy-const-val-conversion, r=lcnr
[rust.git] / src / tools / miri / tests / fail / intrinsics / ptr_offset_int_plus_ptr.rs
1 //@compile-flags: -Zmiri-permissive-provenance
2
3 fn main() {
4     let ptr = Box::into_raw(Box::new(0u32));
5     // Can't start with an integer pointer and get to something usable
6     unsafe {
7         let _val = (1 as *mut u8).offset(ptr as isize); //~ERROR: is a dangling pointer
8     }
9 }