2018-08-30 07:18:55 -05:00
|
|
|
//@ run-pass
|
2012-09-18 17:52:21 -05:00
|
|
|
|
2015-03-22 15:13:15 -05:00
|
|
|
|
2015-03-25 19:06:52 -05:00
|
|
|
fn test<F>(f: F) -> usize where F: FnOnce(usize) -> usize {
|
2015-03-03 02:42:26 -06:00
|
|
|
return f(22);
|
2011-12-16 15:50:22 -06:00
|
|
|
}
|
|
|
|
|
2013-02-01 21:43:17 -06:00
|
|
|
pub fn main() {
|
2015-03-03 02:42:26 -06:00
|
|
|
let y = test(|x| 4 * x);
|
|
|
|
assert_eq!(y, 88);
|
2012-09-18 17:52:21 -05:00
|
|
|
}
|