RS.CLIPPY.PRECEDENCE_BITS
Operations mixing bit shifting with bit combining/masking
This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: precedence_bits. Copyright ©2025 The Rust Team. All rights reserved.
What it does
Checks for bit shifting operations combined with bit masking/combining operators and suggest using parentheses.
Why restrict this?
Not everyone knows the precedence of those operators by heart, so expressions like these may trip others trying to reason about the code.
Example
0x2345 & 0xF000 >> 12 equals 5, while (0x2345 & 0xF000) >> 12 equals 2