News for hackers. Stuff that matters.
Re:Partial Operator Precedence by kibwen on Thursday November 05, 2026 @08:58AM (#50379124)
> It would be good to get it as a linting/formatting rule in Rust too (maybe that already exists?).

Yes, Clippy has a "precedence" lint that's enabled by default: https://clippy.rust-lang.org/master/index.html?search=preced...

Here's what it looks like:

    warning: operator precedence might not be obvious
     --> src/main.rs:2:5
      |
    2 |     1 << 2 + 3;
      |     ^^^^^^^^^^ help: consider parenthesizing your expression: `1 << (2 + 3)`
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#precedence
      = note: `#[warn(clippy::precedence)]` on by default

There are no comments on this comment yet.