rust-lang / rust-lang/rust

Outdated comment about std::hash::DefaultHasher being inaccessible

Open
#134,717 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-docs T-libs
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Location

https://github.com/rust-lang/rust/blob/f3343420c813a3dad6746e274137ba51bf97f063/library/std/src/hash/random.rs#L5-L6

Summary

This comment in library/std/src/hash/random.rs says
Although its items are public and contain stability attributes, they can't actually be accessed outside this crate.

However, std:#️⃣:DefaultHasher and RandomState are accessible since version 1.76 (feature = "std_hash_exports"). The comment predates that, so I suppose it's outdated and should be reworded or removed to avoid confusion.

Somewhat related: https://doc.rust-lang.org/std/index.html?search=DefaultHasher only shows std::collections::hash_map::DefaultHasher, while presumably it should also show std:#️⃣:DefaultHasher. Please let me know if there's a better way to report that one, as I'm not sure what the best venue would be.

Contributor guide

Open the contributing guide

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

Start at library/std/src/hash/random.rs#L5-L6 and compare the comment with the issue's note that std:#️⃣:DefaultHasher and RandomState are accessible since Rust 1.76. Update or remove the outdated wording, then separately check whether the reported std documentation search result needs a follow-up issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.