Closed
Description
Summary
Happy trigger
Lint Name
manual_is_multiple_of
Reproducer
I tried this code:
fn any_rem<T: std::ops::Rem<Output = u32>>(a: T, b: T) {
// An arbitrary `Rem` implementation should not lint
let _ = a % b == 0;
}
I saw this happen:
5 | let _ = a % b == 0;
| ^^^^^^^^^^ help: replace with: `a.is_multiple_of(b)`
This should not trigger as .is_multiple_of()
is only implemented on unsigned integer types by default.
Version
rustc 1.90.0-nightly (667787527 2025-07-02)
binary: rustc
commit-hash: 6677875279b560442a07a08d5119b4cd6b3c5593
commit-date: 2025-07-02
host: x86_64-unknown-linux-gnu
release: 1.90.0-nightly
LLVM version: 20.1.7