rust/tests/compile-fail/validity/invalid_fnptr_uninit.rs
2021-02-16 09:55:33 +01:00

12 lines
261 B
Rust

// ignore-test FIXME (Miri issue #1711)
#![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
}