]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/fail/uninit_byte_read.rs
Rollup merge of #105459 - jyn514:proc-macro-default, r=Mark-Simulacrum
[rust.git] / src / tools / miri / tests / fail / uninit_byte_read.rs
1 //@compile-flags: -Zmiri-disable-stacked-borrows
2 fn main() {
3     let v: Vec<u8> = Vec::with_capacity(10);
4     let undef = unsafe { *v.get_unchecked(5) }; //~ ERROR: uninitialized
5     let x = undef + 1;
6     panic!("this should never print: {}", x);
7 }