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