-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Document non-guarantees for Hash #90995
Conversation
Dependence on endianness and type sizes was reported for enum discriminants in rust-lang#74215 but it is a more general issue since for example the default implementation of `Hasher::write_usize` uses native endianness. Additionally the implementations of library types are occasionally changed as their internal fields change or hashing gets optimized.
r? @yaahc (rust-highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great!
Co-authored-by: pierwill <19642016+pierwill@users.noreply.github.com>
A hasher that overrides all provided methods could provide a portable hash though, right? E.g. always use LE, and delegate |
That could cover some cases, but the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me. Between here and the module docs, this is the place I would think to look first.
Thanks!
@bors r+ rollup |
📌 Commit 53fc69f has been approved by |
Document non-guarantees for Hash Dependence on endianness and type sizes was reported for enum discriminants in rust-lang#74215 but it is a more general issue since for example the default implementation of `Hasher::write_usize` uses native endianness. Additionally the implementations of library types are occasionally changed as their internal fields change or hashing gets optimized. ## Question Should this go on the module level documentation instead since it also concerns `Hasher` to some extent and not just `Hash`? resolves rust-lang#74215
…askrgr Rollup of 6 pull requests Successful merges: - rust-lang#83791 (Weaken guarantee around advancing underlying iterators in zip) - rust-lang#90995 (Document non-guarantees for Hash) - rust-lang#91057 (Expand `available_parallelism` docs in anticipation of cgroup quota support) - rust-lang#91062 (rustdoc: Consolidate static-file replacement mechanism) - rust-lang#91208 (Account for incorrect `where T::Assoc = Ty` bound) - rust-lang#91266 (Use non-generic inner function for pointer formatting) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Dependence on endianness and type sizes was reported for enum discriminants in #74215 but it is a more general
issue since for example the default implementation of
Hasher::write_usize
uses native endianness.Additionally the implementations of library types are occasionally changed as their internal fields
change or hashing gets optimized.
Question
Should this go on the module level documentation instead since it also concerns
Hasher
to some extent and not justHash
?resolves #74215