RS.CLIPPY.PRECEDENCE
Operations where precedence may be unclear
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. Copyright ©2025 The Rust Team. All rights reserved.
What it does
Checks for operations where precedence may be unclear and suggests to add parentheses. It catches a mixed usage of arithmetic and bit shifting/combining operators without parentheses
Why is this bad?
Not everyone knows the precedence of those operators by heart, so expressions like these may trip others trying to reason about the code.
Example
1 << 2 + 3 equals 32, while (1 << 2) + 3 equals 7