Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dbdr opened this issue Dec 24, 2024 · 3 comments · May be fixed by #135735
Open

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

dbdr opened this issue Dec 24, 2024 · 3 comments · May be fixed by #135735
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@dbdr
Copy link

dbdr commented Dec 24, 2024

Location

//! Although its items are public and contain stability attributes, they can't actually be accessed
//! outside this crate.

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::hash::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::hash::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.

@dbdr dbdr added the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label Dec 24, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 24, 2024
@jieyouxu jieyouxu added T-libs Relevant to the library team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Dec 24, 2024
@notriddle
Copy link
Contributor

notriddle commented Dec 27, 2024

std::collections::hash_map::DefaultHasher, while presumably it should also show std::hash::DefaultHasher

The search engine is only supposed to show one path for any particular item.

@hkBst
Copy link
Member

hkBst commented Jan 19, 2025

@dbdr I think you are correct about these lines being wrong now: The random mod only contains two items which are both pub and which are both reexported since 1.76.0 as you said. My proposed fix would be to just remove these outdated comments.

Would you want to try to do that yourself or would you prefer if I did that?

@dbdr
Copy link
Author

dbdr commented Jan 19, 2025

@hkBst thanks for the confirmation. I'll submit a PR, happy to make a small contribution and learn about the process, in case I have the chance to do more in the future.

dbdr added a commit to dbdr/rust that referenced this issue Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants