about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/errors.rs
diff options
context:
space:
mode:
authorAlejandra González <blyxyas@gmail.com>2025-06-20 09:43:53 +0000
committerGitHub <noreply@github.com>2025-06-20 09:43:53 +0000
commit2c1c746ebd4e49e3578a452a02b9757e33512585 (patch)
tree043509d5f154a2d35c8763923264bc0df5a28989 /compiler/rustc_codegen_llvm/src/errors.rs
parent8ec6f1a96f471a72e7cfed072b5eb4f4b85bc6d6 (diff)
parent6ffff5f009d951098d4762af1ec449f296787fe4 (diff)
downloadrust-2c1c746ebd4e49e3578a452a02b9757e33512585.tar.gz
rust-2c1c746ebd4e49e3578a452a02b9757e33512585.zip
New lint: `manual_is_multiple_of` (#14292)
~~I've added a `min_divisor` configuration option, default to 4, to not
trigger on smaller divisibility operations. I would prefer not to lint
`if a & 1 == 0` as `if a.is_multiple_of(2)` by default because the
former is very idiomatic in systems (and embedded) programming.~~

~~A `min_and_mask_size` option, defaulting to 3, sets the default bits
to be and-masked before this lint triggers; that would be `n` in `v &
((1 << n) - 1) == 0`. The form `v % 10 == 0` is always linted.~~

~~This PR will stay in draft mode until the next rustup which will mark
`unsigned_is_multiple_of` stable for Rust 1.87.0, and the feature flags
will be removed.~~

What should its category be? I've used "complexity", but "pedantic"
might be suitable as well.

Close rust-lang/rust-clippy#14289
changelog: [`manual_is_multiple_of`]: new lint
r? ghost
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/errors.rs')
0 files changed, 0 insertions, 0 deletions