diff options
| author | bors <bors@rust-lang.org> | 2015-03-29 14:02:28 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-03-29 14:02:28 +0000 |
| commit | b27ba527c5cee06f43967daf3a0dd01a2258a0fa (patch) | |
| tree | 2d31bf590f7da7173d7ffce609c6aa2a22eb97f6 /src/libcore | |
| parent | ea03ad961669e69d57cb0ae1a48b53b4b49a8342 (diff) | |
| parent | 9147463678341db09c36d1a24a643b8ba4e3be73 (diff) | |
| download | rust-b27ba527c5cee06f43967daf3a0dd01a2258a0fa.tar.gz rust-b27ba527c5cee06f43967daf3a0dd01a2258a0fa.zip | |
Auto merge of #23831 - Manishearth:rollup, r=Manishearth
- Successful merges: #23811, #23814, #23817, #23821, #23829 - Failed merges:
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/hash/mod.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libcore/hash/mod.rs b/src/libcore/hash/mod.rs index 2feb2f8b1e3..2375ae89650 100644 --- a/src/libcore/hash/mod.rs +++ b/src/libcore/hash/mod.rs @@ -73,6 +73,16 @@ mod sip; /// /// The `H` type parameter is an abstract hash state that is used by the `Hash` /// to compute the hash. +/// +/// If you are also implementing `Eq`, there is an additional property that +/// is important: +/// +/// ```text +/// k1 == k2 -> hash(k1) == hash(k2) +/// ``` +/// +/// In other words, if two keys are equal, their hashes should also be equal. +/// `HashMap` and `HashSet` both rely on this behavior. #[stable(feature = "rust1", since = "1.0.0")] pub trait Hash { /// Feeds this value into the state given, updating the hasher as necessary. |
