about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorAlex Macleod <alex@macleod.io>2025-01-24 15:48:44 +0000
committerGitHub <noreply@github.com>2025-01-24 15:48:44 +0000
commitd7e20a9c163ad00ebc93671fd123dc11ee0dae8b (patch)
tree788dc78301dd4d6ff55dd8461f3b8c5dc2726500 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parent4b05f50b6bb12095a197b0390e57fb92149e99ac (diff)
parenta18b75a87ed29a074cb751c840ccff65cbd12815 (diff)
downloadrust-d7e20a9c163ad00ebc93671fd123dc11ee0dae8b.tar.gz
rust-d7e20a9c163ad00ebc93671fd123dc11ee0dae8b.zip
docs: fix verbose-bit-mask example (#14055)
changelog: none

`x & 15 == 0` is not equivalent to `x.trailing_zeros() > 4`, as `x =
0b10000` is true for the former and false for the latter.

In fact, clippy itself suggests the following:

```rust
pub fn src(x: i32) -> bool {
    x & 15 == 0 // ~error: bit mask could be simplified with a call to `trailing_zeros`
    ^^^^^^^^^^^ help: try: `x.trailing_zeros() >= 4`
}
```
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions