diff options
| author | Alejandra González <blyxyas@gmail.com> | 2025-06-20 09:43:53 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-20 09:43:53 +0000 |
| commit | 2c1c746ebd4e49e3578a452a02b9757e33512585 (patch) | |
| tree | 043509d5f154a2d35c8763923264bc0df5a28989 /compiler/rustc_codegen_llvm/src | |
| parent | 8ec6f1a96f471a72e7cfed072b5eb4f4b85bc6d6 (diff) | |
| parent | 6ffff5f009d951098d4762af1ec449f296787fe4 (diff) | |
| download | rust-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')
0 files changed, 0 insertions, 0 deletions
