1 2 3 4 5 6 7 8 9 10 11
// run-pass // Test HRTB used with the `Fn` trait. fn foo<F:Fn(&isize)>(f: F) { let x = 22; f(&x); } fn main() { foo(|x: &isize| println!("{}", *x)); }