summaryrefslogtreecommitdiffstats
path: root/src/test/ui/closures/old-closure-arg-call-as.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/closures/old-closure-arg-call-as.rs')
-rw-r--r--src/test/ui/closures/old-closure-arg-call-as.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/closures/old-closure-arg-call-as.rs b/src/test/ui/closures/old-closure-arg-call-as.rs
new file mode 100644
index 000000000..87cf3a487
--- /dev/null
+++ b/src/test/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);
+}