1 2 3 4 5 6 7 8 9 10 11
// run-pass fn test<F>(f: F) -> usize where F: FnOnce(usize) -> usize { return f(22); } pub fn main() { let y = test(|x| 4 * x); assert_eq!(y, 88); }