2022-07-08 11:08:32 -05:00
|
|
|
//@compile-flags: -Zmiri-disable-stacked-borrows
|
2016-06-13 07:27:05 -05:00
|
|
|
fn main() {
|
|
|
|
let v: Vec<u8> = Vec::with_capacity(10);
|
2022-07-11 06:44:55 -05:00
|
|
|
let undef = unsafe { *v.get_unchecked(5) }; //~ ERROR: uninitialized
|
2022-06-06 10:44:36 -05:00
|
|
|
let x = undef + 1;
|
2016-06-13 07:27:05 -05:00
|
|
|
panic!("this should never print: {}", x);
|
|
|
|
}
|