-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Check for missing space between fat arrow and range pattern #107425
Conversation
r? @lcnr (rustbot has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Minor tweaks, then I can approve.
0e4d582
to
67a3967
Compare
cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonderful, thanks
@clubby789 can you fix the errors? |
67a3967
to
c568879
Compare
@bors r+ |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#106618 (Disable `linux_ext` in wasm32 and fortanix rustdoc builds.) - rust-lang#107097 (Fix def-use dominance check) - rust-lang#107154 (library/std/sys_common: Define MIN_ALIGN for m68k-unknown-linux-gnu) - rust-lang#107397 (Gracefully exit if --keep-stage flag is used on a clean source tree) - rust-lang#107401 (remove the usize field from CandidateSource::AliasBound) - rust-lang#107413 (make more pleasant to read) - rust-lang#107422 (Also erase substs for new infcx in pin move error) - rust-lang#107425 (Check for missing space between fat arrow and range pattern) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
@@ -0,0 +1,19 @@ | |||
error: unexpected `=>` after open range |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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 InclusiveRangeStart(74) >
and not ExclusiveRangeStart(74) =>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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 >
after inclusive range", perhaps with a label saying something like:
--> $DIR/half-open-range-pats-inclusive-match-arrow.rs:5:11
|
LL | 74..=> {},
| ^^^ This is parsed as an inclusive range `..=`
@clubby789, would you like to follow up on this message?
…, r=estebank Improve diagnostic for missing space in range pattern Improves the diagnostic in rust-lang#107425 by turning it into a note explaining the parsing issue. r? `@compiler-errors`
…, r=estebank Improve diagnostic for missing space in range pattern Improves the diagnostic in rust-lang#107425 by turning it into a note explaining the parsing issue. r? `@compiler-errors`
…, r=estebank Improve diagnostic for missing space in range pattern Improves the diagnostic in rust-lang#107425 by turning it into a note explaining the parsing issue. r? `@compiler-errors`
Fixes #107420
Ideally we wouldn't emit an error about expecting
=>
etc., but I'm not sure how to recover from this.@rustbot label +A-diagnostics