Skip to content

Tracking issue for custom hashers in HashMap #27713

Closed
@alexcrichton

Description

@alexcrichton

This is a tracking issue for the unstable hashmap_hasher feature in the standard library. This provides the ability to create a HashMap with a custom hashing implementation that abides by the HashState trait. This has already been used quite a bit in the compiler itself as well as in Servo I believe.

Some notable points to consider:

  • Is an extra HashState trait really necessary?
  • Is the naming of HashState correct?
  • Is the aggressive use of Default appropriate here?
  • Can the new constructor be leveraged to create hash maps that use a hasher implementing Default? Right now the new constructor only works with RandomState.
  • How ergonomic is it to create a hash map using a custom Hasher implementation? In theory it should be quite ergonomic.

cc @gankro

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-collectionsArea: `std::collections`B-unstableBlocker: Implemented in the nightly compiler and unstable.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.final-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions