about summary refs log tree commit diff
path: root/src/tools/miri/tests/fail/intrinsics/ptr_offset_overflow.rs
blob: 6767b1f117a8ff715b1253e6d943b6d8788b362e (plain)
1
2
3
4
5
6
7
8
//@normalize-stderr-test: "\d+ bytes" -> "$$BYTES bytes"

fn main() {
    let v = [0i8; 4];
    let x = &v as *const i8;
    let x = unsafe { x.offset(isize::MIN) }; //~ERROR: in-bounds pointer arithmetic failed
    panic!("this should never print: {:?}", x);
}