-
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
mut_range_bound
check for immediate break after mutation
#7607
Conversation
r? @flip1995 (rust-highfive has picked a reviewer for you, use r? to override) |
b72baca
to
2035b1d
Compare
☔ The latest upstream changes (presumably #7604) made this pull request unmergeable. Please resolve the merge conflicts. |
2035b1d
to
47ecff6
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.
LGTM now. All comments are about technical debt with this lint, which you uncovered by working on this lint 😛
47ecff6
to
8300878
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.
Last comment. Thank for addressing all of my complaints 😄
clippy_lints/src/loops/mod.rs
Outdated
/// False positive when mutation is not immediately followed by a break statement | ||
/// False positive on nested expressions ([#6072](https://github.com/rust-lang/rust-clippy/issues/6072)) |
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.
/// False positive when mutation is not immediately followed by a break statement | |
/// False positive on nested expressions ([#6072](https://github.com/rust-lang/rust-clippy/issues/6072)) | |
/// False positive when mutation is followed by a `break`, but the `break` is not immediately after the mutation: | |
/// | |
/// ``` | |
/// x += 1; // x is range bound | |
/// some_other_expr(); | |
/// break; // leaves the loop so mutating is not an issue | |
/// ``` | |
/// | |
/// False positive on nested loops ([#6072](https://github.com/rust-lang/rust-clippy/issues/6072)) |
8300878
to
7c40cfd
Compare
7c40cfd
to
dc6f7dc
Compare
@bors r+ Thanks! |
📌 Commit dc6f7dc has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
closes #7532
mut_range_bound
ignores mutation on range bounds that is placed immediately before break. Still warns if the break is not always reachable.changelog: [
mut_range_bound
] ignore range bound mutations before immediate break