-
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 [redundant_guards
]
#10955
new lint [redundant_guards
]
#10955
Conversation
r? @Manishearth (rustbot has picked a reviewer for you, use r? to override) |
74d92ce
to
67e6227
Compare
80ebc4d
to
7d996c0
Compare
Yep, will review it! 🌵 |
☔ The latest upstream changes (presumably #10934) 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.
wow, I imagine this has been pretty hard to do. Pretty cool (and useful!) lint. Thanks! ❤️ (Some veeery minor nits)
Just noticed, we should probably put this in the |
e089637
to
bc3a80e
Compare
@Alexendoo, do you maybe want to take over the after/co review with @blyxyas ? Then I would hand this PR over to you two :) |
bc3a80e
to
3745d23
Compare
Sure thing @xFrednet |
3745d23
to
d9d9021
Compare
d9d9021
to
94beb9d
Compare
I've applied your suggestions minus ignoring |
9d9ee0f
to
8b113bf
Compare
8b113bf
to
edbaca0
Compare
edbaca0
to
2c4620b
Compare
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.
Thanks, just one last nit and then if you could squash the commits that'd be great
6c75a5b
to
0470b78
Compare
☔ The latest upstream changes (presumably #10885) made this pull request unmergeable. Please resolve the merge conflicts. |
0470b78
to
51b5772
Compare
Thanks again! @bors r=Alexendoo,blyxyas |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Hi, just upgraded to 1.73 and notice this new lint. I've upgraded my code and this snippet: let input = input.parse::<i32>().unwrap();
match input {
i if i == -1 => println!("-1"),
i if i == 0 => println!("0"),
i => println!("{i}")
} Triggers the following clippy warning:
Fixing the snippet, I've now: let input = &args[1];
let input = input.parse::<i32>().unwrap();
match input {
i if i == -1 => println!("-1"),
0 => println!("0"),
i => println!("{i}")
} And no more clippy warning! I find it odd that the branch |
Good catch, opened #11641 to cover that I always forget that |
Closes #7825, maybe somebody else can get the ranges lint in the comments?
changelog: New lint [
redundant_guards
]