rust/tests/compile-fail/intrinsics/zero_fn_ptr.rs

7 lines
212 B
Rust

// error-pattern: the evaluated program aborted execution: attempted to zero-initialize type `fn()`, which is invalid
#[allow(deprecated, invalid_value)]
fn main() {
unsafe { std::mem::zeroed::<fn()>() };
}