rust/tests/compile-fail/cast_fn_ptr_unsafe2.rs
2016-06-17 16:49:06 +02:00

11 lines
255 B
Rust

// just making sure that fn -> unsafe fn casts are handled by rustc so miri doesn't have to
fn main() {
fn f() {}
let g = f as fn() as fn(i32) as unsafe fn(i32); //~ERROR: non-scalar cast: `fn()` as `fn(i32)`
unsafe {
g(42);
}
}