-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Migrate rustc_mir_build's non_exhaustive_match diagnostic #108278
Conversation
r? @cjgillot (rustbot has picked a reviewer for you, use r? to override) |
|
This comment has been minimized.
This comment has been minimized.
I'm a fan of the primary message being tweaked along these lines -- but could you perhaps split that out into a separate PR that edits the message without doing the diagnostics migration (i.e. using the old diagnostics machinery), so others can chime in on the wording and presentation? Then the diff of this PR would be much smaller, so it's easier for a reviewer to notice more subtle changes due to the refactoring you're doing here? |
I realized this PR would be hard to follow, which is why I did this change in multiple commits. Each of those makes sense on its own, which I hope makes the reviewing easier. |
Well it still needs fixing regardless -- was just trying to make it possible to get some of these changes (at least their presentation) landed before you were able to debug the rest of it. @rustbot author |
This comment has been minimized.
This comment has been minimized.
FTR this is what rust-analyzer prints. Like the current error it's straight to the point, which I prefer: From what I can tell though the rust-analyzer error is native to them though, so this PR won't disrupt that IDE error. I think if the set of patterns not handled becomes very complex then it makes sense to switch to the suggested error scheme and only explain the missing patterns in the report below, but otherwise I prefer the older way where the missing patterns are right at the top. |
| | ||
LL ~ Opcode::OP1 => unimplemented!(), | ||
LL ~ Opcode(0_u8) | Opcode(2_u8..=u8::MAX) => todo!(), | ||
LL + Opcode(0_u8) => { todo!() }, |
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.
Note that while this is also my personal preference, to put a ,
after blocks in match arms, rustfmt's defaults are to omit it.
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 think this should be reverted. If you want to make this change separately, break it out into another PR.
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've reverted the commas.
☔ The latest upstream changes (presumably #103042) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #108640) made this pull request unmergeable. Please resolve the merge conflicts. |
oops i think i forgot this: @rustbot ready |
☔ The latest upstream changes (presumably #108504) made this pull request unmergeable. Please resolve the merge conflicts. |
@rustbot author -- needs a rebase feel free to ping me when this is ready for a review, sorry for just seeing this now |
Ping from triage: FYI: when a PR is ready for review, send a message containing |
I will, my apologies for the delay :) |
@mejrs @rustbot label: +S-inactive |
This also changes the diagnostic somewhat, I hope that's OK