-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
new lint: manual_range_patterns
#10968
Conversation
r? @Manishearth (rustbot has picked a reviewer for you, use r? to override) |
We could probably also lint overlapping ranges, but its probably out of scope :D pub fn main() {
let x: u8 = 3;
let b = matches!(x, 0..=1 | 0..=2 | 0..=3);
} |
Good idea, this now also lints (overlapping) ranges |
☔ The latest upstream changes (presumably #10951) made this pull request unmergeable. Please resolve the merge conflicts. |
Bouncing review to @Centri3 |
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 overall, thanks! Just two minor nits from me :D
Oh this lint should probably be renamed to |
@bors delegate=centri3 |
✌️ @Centri3, you can now approve this pull request! If @Manishearth told you to " |
☔ The latest upstream changes (presumably #10884) made this pull request unmergeable. Please resolve the merge conflicts. |
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.
This looks good, thank you! @Manishearth
oh I forgot I could approve this one already 😅 I really hope I didn't miss something :) @bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Fixes #4931
changelog: new lint: [
manual_range_patterns
]