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

7 lines
171 B
Rust
Raw Normal View History

2020-12-10 12:53:45 -06:00
// error-pattern: attempted to zero-initialize type `fn()`, which is invalid
#[allow(deprecated, invalid_value)]
fn main() {
unsafe { std::mem::zeroed::<fn()>() };
}