rust/tests/fail/validity/invalid_fnptr_uninit.rs

11 lines
188 B
Rust
Raw Normal View History

#![allow(invalid_value)]
union MyUninit {
init: (),
uninit: fn(),
}
fn main() {
2022-02-24 09:55:40 -06:00
let _b = unsafe { MyUninit { init: () }.uninit }; //~ ERROR encountered uninitialized bytes
}