diff options
| author | David Tolnay <dtolnay@gmail.com> | 2023-12-29 17:37:32 -0800 |
|---|---|---|
| committer | David Tolnay <dtolnay@gmail.com> | 2024-05-11 15:49:51 -0700 |
| commit | aedc1b6ad4845242d06a3f7cfb9b57db227b3511 (patch) | |
| tree | 870db4f5636d88f78590959bb71249bf50eb9ca6 /tests/ui | |
| parent | 0f6a51d4958dff5a29c121801bcdd619d71db541 (diff) | |
| download | rust-aedc1b6ad4845242d06a3f7cfb9b57db227b3511.tar.gz rust-aedc1b6ad4845242d06a3f7cfb9b57db227b3511.zip | |
Remove MacCall special case from recovery after missing 'if' after 'else'
The change to the test is a little goofy because the compiler was
guessing "correctly" before that `falsy! {}` is the condition as opposed
to the else body. But I believe this change is fundamentally correct.
Braced macro invocations in statement position are most often item-like
(`thread_local! {...}`) as opposed to parenthesized macro invocations
which are condition-like (`cfg!(...)`).
Diffstat (limited to 'tests/ui')
| -rw-r--r-- | tests/ui/parser/else-no-if.stderr | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/ui/parser/else-no-if.stderr b/tests/ui/parser/else-no-if.stderr index 9954505e7c8..2e3e8f6b50e 100644 --- a/tests/ui/parser/else-no-if.stderr +++ b/tests/ui/parser/else-no-if.stderr @@ -74,14 +74,12 @@ error: expected `{`, found `falsy` --> $DIR/else-no-if.rs:47:12 | LL | } else falsy! {} { - | ---- ^^^^^ - | | - | expected an `if` or a block after this `else` + | ^^^^^ expected `{` | -help: add an `if` if this is the condition of a chained `else if` statement +help: try placing this code inside a block | -LL | } else if falsy! {} { - | ++ +LL | } else { falsy! {} } { + | + + error: expected `{`, found `falsy` --> $DIR/else-no-if.rs:54:12 |
