rust/tests/compile-fail/intrinsics/ptr_offset_overflow.rs
2020-04-11 11:36:55 +02:00

7 lines
174 B
Rust

//error-pattern: overflowing in-bounds pointer arithmetic
fn main() {
let v = [1i8, 2];
let x = &v[1] as *const i8;
let _val = unsafe { x.offset(isize::MIN) };
}