rust/tests/compile-fail/validity/invalid_fnptr_uninit.rs
2021-02-17 09:37:21 +01:00

11 lines
221 B
Rust

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