Skip to content

Tracking Issue for const_collections_with_hasher #102575

Description

@aDotInTheVoid

Feature gate: #![feature(const_collections_with_hasher)]

This is a tracking issue for making HashMap::with_hasher and HashSet::with_hasher const.

Public API

// std::collections
impl<K, V, S> HashMap<K, V, S> {
    pub const fn with_hasher(hash_builder: S) -> HashMap<K, V, S> { ... }
}

impl<T, S> HashSet<T, S> {
    pub const fn with_hasher(hasher: S) -> HashSet<T, S> { ... }
}

Steps / History

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩

Activity

  1. added
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    T-libs-api[DEPRECATED; DO NOT USE]
    on Oct 2, 2022
  2. added a commit that references this issue on Oct 5, 2022
  3. GoldsteinE commented on Jan 3, 2023

    @GoldsteinE
    Contributor

    What blocks this from stabilization? Can I do something to move it forward?

  4. aDotInTheVoid commented on Jan 5, 2023

    @aDotInTheVoid
    MemberAuthor

    @GoldsteinE: see https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

    Main questions for stabilization are do we want to add the constraint that an empty hashmap can be const constructed (ie doesn't alloc and more). This is true for the current hashbrown design, but might not be true for other alternatives. I'm not framiliar enough with hashmap design to say.

  5. Amanieu commented on Aug 3, 2023

    @Amanieu
    Member

    This is fairly straightforward, we are essentially guaranteeing that a newly created HashMap does not allocate any memory.

    @rfcbot fcp merge

  6. rfcbot commented on Aug 3, 2023

    @rfcbot

    Team member @Amanieu has proposed to merge this. The next step is review by the rest of the tagged team members:

    No concerns currently listed.

    Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

    See this document for info about what commands tagged team members can give me.

  7. added
    proposed-final-comment-periodProposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.
    disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.
    final-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.
    and removed
    proposed-final-comment-periodProposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.
    on Aug 3, 2023
  8. rfcbot commented on Aug 3, 2023

    @rfcbot

    🔔 This is now entering its final comment period, as per the review above. 🔔

  9. added
    to-announceAnnounce this issue on triage meeting
    and removed
    final-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.
    on Aug 13, 2023
  10. 15 remaining items

  11. added 2 commits that reference this issue on Nov 3, 2024
  12. added a commit that references this issue on Nov 3, 2024
  13. RalfJung commented on Nov 3, 2024

    @RalfJung
    Member

    The PR that should enable us to safely expose const fn from hashbrown is up now: #132541.

    (That's just the infrastructure for this, once it lands, a bit of wiring-up needs to happen in hashbrown.)

  14. RalfJung commented on Nov 12, 2024

    @RalfJung
    Member

    Cc @rust-lang/wg-const-eval

  15. added 2 commits that reference this issue on Nov 30, 2024
  16. added a commit that references this issue on Nov 30, 2024
  17. added a commit that references this issue on Dec 3, 2024
  18. added a commit that references this issue on Dec 3, 2024
  19. added this to the 1.85.0 milestone on Jan 20, 2025
  20. added 2 commits that reference this issue on Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-api[DEPRECATED; DO NOT USE]disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions