about summary refs log tree commit diff
path: root/tests/ui/closures/old-closure-arg.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/closures/old-closure-arg.rs')
-rw-r--r--tests/ui/closures/old-closure-arg.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/closures/old-closure-arg.rs b/tests/ui/closures/old-closure-arg.rs
new file mode 100644
index 00000000000..bd1385e5c33
--- /dev/null
+++ b/tests/ui/closures/old-closure-arg.rs
@@ -0,0 +1,11 @@
+// run-pass
+// Check usage and precedence of block arguments in expressions:
+pub fn main() {
+    let v = vec![-1.0f64, 0.0, 1.0, 2.0, 3.0];
+
+    // Statement form does not require parentheses:
+    for i in &v {
+        println!("{}", *i);
+    }
+
+}