Skip to content

Please separate clippy::precedence into multiple lints #14097

@joshtriplett

Description

@joshtriplett

I really appreciate the part of clippy::precedence that flags "mixed usage of arithmetic and bit shifting/combining operators without parentheses" (e.g. 1 << 2 + 3).

I would rather not have the part of clippy::precedence that flags "mixed usage of bitmasking and bit shifting operators without parentheses", because when you work with bitmasking regularly, it's reasonably well-known that x | 1 << 10 or y & 1 << 10 has the precedence you would expect.

Could clippy separate these into two separate lints, e.g. clippy::precedence_arithmetic_vs_bits and clippy::precedence_bits?

(I would also make the case that the latter should be allow-by-default, but for this issue I'm just requesting that the two be split.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions