rust/tests/ui/fn/fun-call-variants.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
285 B
Rust
Raw Normal View History

// run-pass
fn ho<F>(f: F) -> isize where F: FnOnce(isize) -> isize { let n: isize = f(3); return n; }
fn direct(x: isize) -> isize { return x + 1; }
2010-06-24 04:03:09 +00:00
pub fn main() {
let a: isize = direct(3); // direct
let b: isize = ho(direct); // indirect unbound
2011-07-27 12:19:39 +00:00
assert_eq!(a, b);
}