forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve diagnostic for missing space in range pattern
- Loading branch information
Showing
6 changed files
with
24 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 6 additions & 10 deletions
16
tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-match-arrow.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,15 @@ | ||
error: unexpected `=>` after open range | ||
--> $DIR/half-open-range-pats-inclusive-match-arrow.rs:5:11 | ||
error: unexpected `>` after inclusive range | ||
--> $DIR/half-open-range-pats-inclusive-match-arrow.rs:5:14 | ||
| | ||
LL | 74..=> {}, | ||
| ^^^ | ||
| ---^ | ||
| | | ||
| this is parsed as an inclusive range `..=` | ||
| | ||
help: add a space between the pattern and `=>` | ||
| | ||
LL | 74.. => {}, | ||
| + | ||
|
||
error: expected one of `=>`, `if`, or `|`, found `>` | ||
--> $DIR/half-open-range-pats-inclusive-match-arrow.rs:5:14 | ||
| | ||
LL | 74..=> {}, | ||
| ^ expected one of `=>`, `if`, or `|` | ||
|
||
error: aborting due to 2 previous errors | ||
error: aborting due to previous error | ||
|