]> git.proxmox.com Git - rustc.git/blob - src/tools/miri/tests/compile-fail/out_of_bounds_read2.rs
New upstream version 1.22.1+dfsg1
[rustc.git] / src / tools / miri / 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: memory access at offset 6, outside bounds of allocation
4 panic!("this should never print: {}", x);
5 }