diff options
| author | Joshua Wong <joshuawong@anticentri.st> | 2025-01-21 19:50:48 -0500 |
|---|---|---|
| committer | Joshua Wong <joshuawong@anticentri.st> | 2025-01-21 19:50:48 -0500 |
| commit | a18b75a87ed29a074cb751c840ccff65cbd12815 (patch) | |
| tree | 3ba10d1ec46b6c607dba2bedd56f2b3b7c20d06e /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | |
| parent | d1b5fa2416f48abc4e5f54df040a3aed864c88cf (diff) | |
| download | rust-a18b75a87ed29a074cb751c840ccff65cbd12815.tar.gz rust-a18b75a87ed29a074cb751c840ccff65cbd12815.zip | |
docs: fix verbose-bit-mask example
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
