summaryrefslogtreecommitdiffstats
path: root/tests/ui/closures/old-closure-arg-call-as.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/closures/old-closure-arg-call-as.rs')
-rw-r--r--tests/ui/closures/old-closure-arg-call-as.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/closures/old-closure-arg-call-as.rs b/tests/ui/closures/old-closure-arg-call-as.rs
new file mode 100644
index 000000000..87cf3a487
--- /dev/null
+++ b/tests/ui/closures/old-closure-arg-call-as.rs
@@ -0,0 +1,12 @@
+// run-pass
+
+#![allow(non_snake_case)]
+
+fn asBlock<F>(f: F) -> usize where F: FnOnce() -> usize {
+ return f();
+}
+
+pub fn main() {
+ let x = asBlock(|| 22);
+ assert_eq!(x, 22);
+}