rust/tests/ui/cast/cast-to-bare-fn.rs
2023-01-11 09:32:08 +00:00

11 lines
242 B
Rust

fn foo(_x: isize) { }
fn main() {
let v: u64 = 5;
let x = foo as extern "C" fn() -> isize;
//~^ ERROR non-primitive cast
let y = v as extern "Rust" fn(isize) -> (isize, isize);
//~^ ERROR non-primitive cast
y(x());
}