rust/tests/fail/validity/invalid_fnptr_null.rs

6 lines
146 B
Rust
Raw Normal View History

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