]> git.lizzy.rs Git - rust.git/blob - tests/fail/intrinsics/out_of_bounds_ptr_2.rs
Auto merge of #2422 - RalfJung:integers, r=oli-obk
[rust.git] / tests / fail / intrinsics / out_of_bounds_ptr_2.rs
1 //@error-pattern: overflowing in-bounds pointer arithmetic
2 fn main() {
3     let v = [0i8; 4];
4     let x = &v as *const i8;
5     let x = unsafe { x.offset(isize::MIN) };
6     panic!("this should never print: {:?}", x);
7 }