Skip to content

scrutinize hash functions: << precedence often misused #1267

Closed
@nikomatsakis

Description

@nikomatsakis

I found that many hash functions in rustc follow this template:

ret foo << 16u + bar;

but by the order of precedence this yields foo << (16u + bar), almost certainly not what was intended. This interacts quite poorly with our hash tables which prefer low-order bits to not be all 0. We need to search through the code and check for similar problems, then close this bug.

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