diff options
Diffstat (limited to 'tests/ui/higher-rank-trait-bounds/hrtb-unboxed-closure-trait.rs')
-rw-r--r-- | tests/ui/higher-rank-trait-bounds/hrtb-unboxed-closure-trait.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/higher-rank-trait-bounds/hrtb-unboxed-closure-trait.rs b/tests/ui/higher-rank-trait-bounds/hrtb-unboxed-closure-trait.rs new file mode 100644 index 000000000..a4a8a5ac6 --- /dev/null +++ b/tests/ui/higher-rank-trait-bounds/hrtb-unboxed-closure-trait.rs @@ -0,0 +1,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)); +} |