rust/clippy_lints
Jason Newcomb 1c64211aee
Fix manual is multiple of (#15205)
Fix several issues with `manual_is_multiple_of`

- `&a % &b == 0` compiles, but requires dereferencing `b` when replacing
with `a.is_multiple_of(b)`.
- In `a % b == 0`, if type of `a` is not certain, `a.is_multiple_of(b)`
might not be typable.
- In `a % b == 0`, `a` and `b` must be unsigned integers, not any
arbitrary types implementing `Rem` and outputing an integer.

Those fixes have required increasing the precision of type certainty
determination in the two first patches.

Fixes rust-lang/rust-clippy#15203
Fixes rust-lang/rust-clippy#15204

changelog: [`manual_is_multiple_of`]: fix various false positive
2025-07-14 08:33:27 +00:00
..
2025-07-14 08:33:27 +00:00

This crate contains Clippy lints. For the main crate, check GitHub.