Skip to content

Remove outdated comment about std::hash::DefaultHasher being inaccessible #135735

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions library/std/src/hash/random.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
//! [`collections`] module without actually publicly exporting them, so that parts of that
//! implementation can more easily be moved to the [`alloc`] crate.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this comment is outdated too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. So should this entire module be unmoduled and inlined into another file?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just inline this into https://github.com/rust-lang/rust/blob/master/library/std/src/hash/mod.rs without mod wrapper?

//!
//! Although its items are public and contain stability attributes, they can't actually be accessed
//! outside this crate.
//!
Comment on lines -5 to -7
Copy link
Member

@ibraheemdev ibraheemdev Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taking a closer look, I think the comments are actually correct. This module was added in #115694 for the reasons the comment mentions. I think we can confusion by mentioning that the types are re-exported elsewhere.

- //! Although its items are public and contain stability attributes, they can't actually be accessed
- //! outside this crate.
+ //! Although its items are public and contain stability attributes, they can't actually be accessed
+ //! through this module, and are instead re-exported from `std::hash` and `std::collections::hash_map`.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think this comment is more confusing than enlightening, and best removed. It's a crate-private module with exports through https://github.com/rust-lang/rust/blob/master/library/std/src/hash/mod.rs.

//! [`collections`]: crate::collections

#[allow(deprecated)]
Expand Down
Loading