-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Check for missing space between fat arrow and range pattern #107425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
fn main() { | ||
let x = 42; | ||
match x { | ||
0..=73 => {}, | ||
74..=> {}, //~ ERROR unexpected `=>` after open range | ||
//~^ ERROR expected one of `=>`, `if`, or `|`, found `>` | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
error: unexpected `=>` after open range | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would have preferred more elaboration in this message. Right now the suggestion helps the user, but it doesn't teach the user what the problem actually was (this was parsed as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, I agree that this message is confusing now that I look at it. It honestly could've probably just been left as the old primary, like "unexpected
@clubby789, would you like to follow up on this message? |
||
--> $DIR/half-open-range-pats-inclusive-match-arrow.rs:5:11 | ||
| | ||
LL | 74..=> {}, | ||
| ^^^ | ||
| | ||
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 | ||
|
Uh oh!
There was an error while loading. Please reload this page.