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