2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2014-11-15 19:10:22 -05:00
|
|
|
// Test HRTB used with the `Fn` trait.
|
|
|
|
|
|
2015-03-25 17:06:52 -07:00
|
|
|
fn foo<F:Fn(&isize)>(f: F) {
|
2014-11-15 19:10:22 -05:00
|
|
|
let x = 22;
|
|
|
|
|
f(&x);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {
|
2015-03-25 17:06:52 -07:00
|
|
|
foo(|x: &isize| println!("{}", *x));
|
2014-11-15 19:10:22 -05:00
|
|
|
}
|