rust/tests/fail/validity/invalid_char_uninit.rs

11 lines
171 B
Rust
Raw Normal View History

#![allow(invalid_value)]
union MyUninit {
init: (),
uninit: char,
}
fn main() {
let _b = unsafe { MyUninit { init: () }.uninit }; //~ ERROR: uninitialized
}