Files
rust/tests/compile-fail-fullmir/ptr_offset_overflow.rs
2018-07-12 11:02:48 +02:00

7 lines
167 B
Rust

//error-pattern: attempt to add with overflow
fn main() {
let v = [1i8, 2];
let x = &v[1] as *const i8;
let _ = unsafe { x.offset(isize::min_value()) };
}