rust-lang / rust-lang/hashbrown

Consider implementing `entries(&mut self) -> impl Iterator<Item = OccupiedEntryRef>`

Open
#426 7 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
3k
Forks
358
Avg merge
11h 57m
Merged PRs (30d)
2

Description

See my comment here for the motivation: https://github.com/rust-lang/rust/issues/59618#issuecomment-1520583112 .

Unfortunately, the impl can't just be added. hashbrown's EntryRefs are currently Send, which means that they can't be allowed to co-exist. Allowing this API would require removing the Send impls on those types. Before someone starts with the implementation, is that something the crate would consider? The tradeoff is pretty clearly well-motivated imo, especially since the entry types already have lifetimes and so aren't exactly likely to be sent across threads much.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the linked Rust issue comment for the motivation, then inspect hashbrown's EntryRef types and their Send implementations. Determine whether the proposed entries iterator can coexist with those types under the stated tradeoff; the issue is complete when that API and compatibility decision is resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.