Skip to content

Lint on uses of XOR as if it were POW: 2 ^ 32 #61934

Closed
@estebank

Description

@estebank

Given 2^32 is a common enough mistake to make, to the point that GCC is adding a lint for it, we probably should lint 2 ^ 8, 2 ^ 16, 2 ^ 32 and 2 ^ 64 as well and suggest 2u64.pow(x) or even better std::u64::MAX.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions