rust/tests/fail/validity/invalid_fnptr_null.rs

6 lines
145 B
Rust
Raw Normal View History

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