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