2015-03-25 19:06:52 -05:00
|
|
|
fn ho<F>(f: F) -> isize where F: FnOnce(isize) -> isize { let n: isize = f(3); return n; }
|
2011-06-15 13:19:50 -05:00
|
|
|
|
2015-03-25 19:06:52 -05:00
|
|
|
fn direct(x: isize) -> isize { return x + 1; }
|
2010-06-23 23:03:09 -05:00
|
|
|
|
2013-02-01 21:43:17 -06:00
|
|
|
pub fn main() {
|
2015-03-25 19:06:52 -05:00
|
|
|
let a: isize = direct(3); // direct
|
|
|
|
let b: isize = ho(direct); // indirect unbound
|
2011-07-27 07:19:39 -05:00
|
|
|
|
2013-05-18 21:02:45 -05:00
|
|
|
assert_eq!(a, b);
|
2011-08-19 17:16:48 -05:00
|
|
|
}
|