You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dbdr opened this issue
Dec 24, 2024
· 3 comments
· May be fixed by #135735
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-libsRelevant to the library team, which will review and decide on the PR/issue.
//! 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.
The text was updated successfully, but these errors were encountered:
dbdr
added
the
A-docs
Area: Documentation for any part of the project, including the compiler, standard library, and tools
label
Dec 24, 2024
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
@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?
@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
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-libsRelevant to the library team, which will review and decide on the PR/issue.
Location
rust/library/std/src/hash/random.rs
Lines 5 to 6 in f334342
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.
The text was updated successfully, but these errors were encountered: