rust/tests/compile-fail/validity/invalid_fnptr_uninit.rs
2022-02-24 10:55:40 -05:00

11 lines
188 B
Rust

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