]> git.lizzy.rs Git - rust.git/blob - tests/compile-fail/out_of_bounds_read2.rs
Auto merge of #1308 - RalfJung:miri, r=RalfJung
[rust.git] / tests / compile-fail / out_of_bounds_read2.rs
1 fn main() {
2     let v: Vec<u8> = vec![1, 2];
3     let x = unsafe { *v.as_ptr().wrapping_offset(5) }; //~ ERROR outside bounds of alloc
4     panic!("this should never print: {}", x);
5 }