Commit 629a69f
committed
Better account for
If a macro statement has been parsed after `else`, suggest a missing `if`:
```
error: expected `{`, found `falsy`
--> $DIR/else-no-if.rs:47:12
|
LL | } else falsy! {} {
| ---- ^^^^^
| |
| expected an `if` or a block after this `else`
|
help: add an `if` if this is the condition of a chained `else if` statement
|
LL | } else if falsy! {} {
| ++
```else if macro conditions mising an if
1 parent 04fe839 commit 629a69f
File tree
2 files changed
+18
-2
lines changed- compiler/rustc_parse/src/parser
- tests/ui/parser
2 files changed
+18
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2683 | 2683 | | |
2684 | 2684 | | |
2685 | 2685 | | |
| 2686 | + | |
| 2687 | + | |
| 2688 | + | |
| 2689 | + | |
| 2690 | + | |
| 2691 | + | |
| 2692 | + | |
2686 | 2693 | | |
2687 | 2694 | | |
2688 | 2695 | | |
| |||
2693 | 2700 | | |
2694 | 2701 | | |
2695 | 2702 | | |
2696 | | - | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
2697 | 2706 | | |
2698 | 2707 | | |
2699 | 2708 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
78 | 85 | | |
79 | 86 | | |
80 | 87 | | |
| |||
0 commit comments