From bfa43ca3011bd1296cb1797ad3ea1c5dc4056749 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Wed, 4 Jul 2012 17:30:46 -0700 Subject: [PATCH] Add tests for various ways to write 'do' and 'for' without args --- src/test/run-pass/do-for-empty-args.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/test/run-pass/do-for-empty-args.rs diff --git a/src/test/run-pass/do-for-empty-args.rs b/src/test/run-pass/do-for-empty-args.rs new file mode 100644 index 00000000000..e486980af7b --- /dev/null +++ b/src/test/run-pass/do-for-empty-args.rs @@ -0,0 +1,16 @@ +// no-reformat +// Testing various forms of `do` and `for` with empty arg lists + +fn f(f: fn() -> bool) { +} + +fn main() { + do f() || { true } + do f() { true } + do f || { true } + do f { true } + for f() || { } + for f() { } + for f || { } + for f { } +}