rust/tests/fail/validity/invalid_bool_uninit.rs
2022-07-11 11:48:56 +00:00

11 lines
213 B
Rust

#![allow(invalid_value)]
union MyUninit {
init: (),
uninit: bool,
}
fn main() {
let _b = unsafe { MyUninit { init: () }.uninit }; //~ ERROR: encountered uninitialized bytes, but expected a boolean
}