]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_read2.rs
Auto merge of #100980 - compiler-errors:normalize-opaque-w-bound-vars, r=lcnr
[rust.git] / src / tools / miri / tests / fail / dangling_pointers / 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: out-of-bounds
4     panic!("this should never print: {}", x);
5 }