Add manual_checked_div lint
changelog: [manual_checked_div]: new lint suggesting checked_div instead of manual zero checks before unsigned division
Implements the manual checked div from rust-lang/rust-clippy#12894. I'm relatively new to Rust and a complete newbie at Clippy, so my apologies if I forgot anything. I looked through the linked issue and could not find anything talking about the above lint.
r? @samueltardieu
rustbot has assigned @samueltardieu. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.
Use r? to explicitly pick a reviewer
No changes for aef068ae15396b39b86bd45249ec92f24fb98db2
:umbrella: The latest upstream changes (possibly a10cafebcdd63d95823ec8bff67a22a71a15a32d) made this pull request unmergeable. Please resolve the merge conflicts.
@amerikrainian Could you look at, and probably apply, @ada4a's suggestions? @rustbot author
Reminder, once the PR becomes ready for a review, use @rustbot ready.
@amerikrainian Could you look at, and probably apply, @ada4a's suggestions? @rustbot author
Yes. I'm sorry. I'm a student and we're in the finals season, so I am deep in the trenches until tomorrow; will do my best to get this done before Friday.
No hurry, I just wanted to make sure you noticed them. Take your time.
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.
Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.
Applied @ada4a’s suggestions and rebased.
I also went ahead and gave multiple divisions implementation a shot; it turned out to be rather straightforward, although I'm not sure if the current form is what was intended.
I promise future feedback won't take as long to be applied.
@rustbot ready
I'm happy to update this for the /=, %, and %= cases, I just wanted to ensure that this is what you had in mind. I updated the tests with the listed negative examples and enforced first use/purity of divisor expressions since I think it's more trickier and extension to other ops should be mechanical and straightforward. Is this what you intended?
@rustbot ready
:umbrella: The latest upstream changes (possibly 741b684c90097002ca98322160c6c92e7a248b47) made this pull request unmergeable. Please resolve the merge conflicts.