rust/tests/fail/validity/invalid_char_uninit.rs
2022-06-01 10:53:38 -04:00

11 lines
231 B
Rust

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