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 { } +}