about summary refs log tree commit diff
path: root/src/tools/miri/tests/fail/intrinsics/ptr_offset_from_oob.rs
blob: 06f6b7a01174616235c2081b018b5caa52b81b7e (plain)
1
2
3
4
5
6
7
fn main() {
    let mem = [0u8; 1];
    let ptr = mem.as_ptr();
    unsafe {
        ptr.wrapping_add(4).offset_from(ptr); //~ERROR: the memory range between them is not in-bounds of an allocation
    }
}