rust/tests/compile-fail/cast_fn_ptr.rs

10 lines
159 B
Rust
Raw Normal View History

2016-08-27 02:44:46 -05:00
fn main() {
fn f() {}
2016-08-27 02:44:46 -05:00
let g = unsafe { //~ ERROR tried to call a function of type
std::mem::transmute::<fn(), fn(i32)>(f)
};
g(42)
}