Rename `overlapping_patterns` lint by Nadrieril · Pull Request #78242 · rust-lan...
source link: https://github.com/rust-lang/rust/pull/78242
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
@rust-lang/lang: this renames overlapping_patterns
to overlapping_range_endpoints
to address the confusing description of the lint, as discussed in #65477. This probably requires an FCP, or a sign-off.
The implementation itself looks fine.
Contributor
nikomatsakis commented on Oct 23
Nominating to discuss the name in the lang-team meeting.
The latest upstream changes (presumably #78334) made this pull request unmergeable. Please resolve the merge conflicts.
Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author
force-pushed the
Nadrieril:rename-overlapping_endpoints-lint
The latest upstream changes (presumably #78430) made this pull request unmergeable. Please resolve the merge conflicts.
Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author
The latest upstream changes (presumably #75534) made this pull request unmergeable. Please resolve the merge conflicts.
Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author
From watching the triage meeting it seems the reason for renaming the lint wasn't super clear, so I thought I'd clarify.
The issue is that overlapping_patterns
sounds like it should lint on any kind of patterns that overlap. But that's really not what it does. What it does is specifically check if two ranges have a common endpoint, which could likely be a mistake:
match x { 0..=10 => {} // Oops, probably meant to write `0..10` 10..=20 => {} _ => {} }
Knowing only the name of the lint, one would expect it to lint may more things. Even knowing that it applies to ranges, one would expect it to lint for overlaps like the following, but it doesn't:
match x { 0..10 => {} 5..15 => {} _ => {} }
So it was proposed to rename it to overlapping_range_endpoints
so that the name is an accurate description of what it lints for.
Thanks for watching and commenting! I'd certainly forgotten what this was about.
sounds like it should lint on any kind of patterns that overlap. But that's really not what it does.
I think that's a great summary, and I agree with niko's statement that a better name that other people like is good by me. So
@rfcbot merge
Team member @scottmcm has proposed to merge this. The next step is review by the rest of the tagged team members:
No concerns currently listed.
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!
See this document for info about what commands tagged team members can give me.
Contributor
nikomatsakis commented on Nov 19
Yes, thanks for clarifying! And glad to know people watch the recordings. =)
@rfcbot reviewed
Contributor
bors commented 27 days ago
The latest upstream changes (presumably #79243) made this pull request unmergeable. Please resolve the merge conflicts.
Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author
Contributor
bors commented 22 days ago
The latest upstream changes (presumably #79284) made this pull request unmergeable. Please resolve the merge conflicts.
Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author
Contributor
bors commented 20 days ago
The latest upstream changes (presumably #79523) made this pull request unmergeable. Please resolve the merge conflicts.
Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author
Contributor
Author
Nadrieril commented 20 days ago
The worst thing is that all those merge conflicts are self-inflicted x)
Member
joshtriplett commented 18 days ago
Renaming the lint we have seems good, to make it more self-documenting and less confusing.
I'd also like to see an implementation of the lint people thought overlapping_patterns
was, but that'd be separate.
Contributor
Author
Nadrieril commented 18 days ago
I'd also like to see an implementation of the lint people thought overlapping_patterns was, but that'd be separate.
@joshtriplett That's being discussed here: #65477
rfcbot commented 12 days ago
This is now entering its final comment period, as per the review above.
rfcbot commented 2 days ago
The final comment period, with a disposition to merge, as per the review above, is now complete.
As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.
The RFC will be merged soon.
@@ -320,7 +318,8 @@ impl IntRange {
),
);
}
err.note("this is likely to be a mistake");
err.span_label(pcx.span, "... with this range");
varkor 7 hours ago
Member
Ah, this didn't have the effect I hoped it would. I forget how vertical label ordering is determined: I guess by span location?
Nadrieril 5 hours ago •
Author
Contributor
I'm not sure, but I think it's only the tests that involve macros that are confusing. In normal cases the ranges will be on different lines of a match and the messages will be in the order we want them
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK