2022-08-27 14:59:27 -05:00
|
|
|
#![allow(invalid_value)]
|
2021-10-24 15:43:47 -05:00
|
|
|
// This test is from https://github.com/rust-lang/miri/issues/1340#issue-600900312.
|
|
|
|
|
|
|
|
fn main() {
|
2022-08-27 14:59:27 -05:00
|
|
|
// The array avoids a `Scalar` layout which detects uninit without even doing validation.
|
|
|
|
let _val = unsafe { std::mem::MaybeUninit::<[usize; 1]>::uninit().assume_init() };
|
2022-08-01 20:34:28 -05:00
|
|
|
//~^ ERROR: uninitialized
|
2021-10-24 15:43:47 -05:00
|
|
|
}
|