rust/tests/fail/validity/invalid_fnptr_null.rs

6 lines
146 B
Rust
Raw Normal View History

2022-02-24 10:55:40 -05:00
#![allow(invalid_value)]
fn main() {
let _b: fn() = unsafe { std::mem::transmute(0usize) }; //~ ERROR: encountered a null function pointer
2022-02-24 10:55:40 -05:00
}