rust/src/test/run-pass/fun-indirect-call.rs
2018-12-25 21:08:33 -07:00

8 lines
127 B
Rust

fn f() -> isize { return 42; }
pub fn main() {
let g: fn() -> isize = f;
let i: isize = g();
assert_eq!(i, 42);
}