Uh oh!
There was an error while loading. Please reload this page.
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.
rust-highfive
commented
Nov 18, 2021
r? @yaahc (rust-highfive has picked a reviewer for you, use r? to override) |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: pierwill <19642016+pierwill@users.noreply.github.com>
nbdd0121
commented
Nov 24, 2021
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 |
dtolnay
left a comment
There was a problem hiding this comment.
This looks great to me. Between here and the module docs, this is the place I would think to look first.
Thanks!
dtolnay
commented
Nov 26, 2021
@bors r+ rollup |
bors
commented
Nov 26, 2021
📌 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`? resolvesrust-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_usizeuses 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
Hasherto some extent and not justHash?resolves#74215