rust-lang / rust-clippy

A bunch of lints to catch common mistakes and improve your Rust code. Book: https://doc.rust-lang.org/clippy/
https://rust-lang.github.io/rust-clippy/
Other
10.89k stars 1.46k forks source link

Fix false positive in `cast_possible_truncation` #12722

Closed MATSMACKE closed 2 weeks ago

MATSMACKE commented 2 weeks ago

Fixes #12721

changelog: [cast_possible_truncation]: Separated checking whether integer constant has sufficient leading zeroes to be safely casted when getting remainder from bitwise and, since the latter allows a constant on either side of the operator to increase the number of leading zeroes that can be guaranteed.

rustbot commented 2 weeks ago

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Alexendoo (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

Alexendoo commented 2 weeks ago

Great, thanks!

@bors r+

bors commented 2 weeks ago

:pushpin: Commit 0b1f09e6f7c8228b566f035d95b4f2b742e3d0cb has been approved by Alexendoo

It is now in the queue for this repository.

bors commented 2 weeks ago

:hourglass: Testing commit 0b1f09e6f7c8228b566f035d95b4f2b742e3d0cb with merge ca1ddc0e7c8ddfb034bc1cd7c13cfdcadf8a55b6...

bors commented 2 weeks ago

:sunny: Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test Approved by: Alexendoo Pushing ca1ddc0e7c8ddfb034bc1cd7c13cfdcadf8a55b6 to master...