diff options
| author | Alex Macleod <alex@macleod.io> | 2025-01-24 15:48:44 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-24 15:48:44 +0000 |
| commit | d7e20a9c163ad00ebc93671fd123dc11ee0dae8b (patch) | |
| tree | 788dc78301dd4d6ff55dd8461f3b8c5dc2726500 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | |
| parent | 4b05f50b6bb12095a197b0390e57fb92149e99ac (diff) | |
| parent | a18b75a87ed29a074cb751c840ccff65cbd12815 (diff) | |
| download | rust-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
