2022-06-26 20:14:18 -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-06-06 10:44:36 -05:00
|
|
|
let undef = unsafe { *v.get_unchecked(5) }; //~ ERROR uninitialized
|
|
|
|
let x = undef + 1;
|
2016-06-13 07:27:05 -05:00
|
|
|
panic!("this should never print: {}", x);
|
|
|
|
}
|