Skip to content

Commit b27ba52

Browse files
committed
Auto merge of rust-lang#23831 - Manishearth:rollup, r=Manishearth
- Successful merges: rust-lang#23811, rust-lang#23814, rust-lang#23817, rust-lang#23821, rust-lang#23829 - Failed merges:
2 parents ea03ad9 + 9147463 commit b27ba52

File tree

7 files changed

+36
-7
lines changed

7 files changed

+36
-7
lines changed

AUTHORS.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ Peter Schuller <[email protected]>
606606
Peter Williams <[email protected]>
607607
Peter Zotov <[email protected]>
608608
Petter Remen <[email protected]>
609-
Phil Dawes <[email protected]>
609+
Phil Dawes <[email protected]>
610610
Phil Ruffwind <[email protected]>
611611
Philip Munksgaard <[email protected]>
612612
Philipp Brüschweiler <[email protected]>

src/doc/trpl/documentation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ can be useful when changing some options, or when writing a macro.
517517

518518
### Re-exports
519519

520-
`rustdoc` will show the documentation for a publc re-export in both places:
520+
`rustdoc` will show the documentation for a public re-export in both places:
521521

522522
```ignore
523523
extern crate foo;

src/libcollections/slice.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
//!
5151
//! ## Iteration
5252
//!
53-
//! The slices implement `IntoIterator`. The iterators of yield references
54-
//! to the slice elements.
53+
//! The slices implement `IntoIterator`. The iterator yields references to the
54+
//! slice elements.
5555
//!
5656
//! ```
5757
//! let numbers = &[0, 1, 2];

src/libcore/hash/mod.rs

+10
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,16 @@ mod sip;
7373
///
7474
/// The `H` type parameter is an abstract hash state that is used by the `Hash`
7575
/// to compute the hash.
76+
///
77+
/// If you are also implementing `Eq`, there is an additional property that
78+
/// is important:
79+
///
80+
/// ```text
81+
/// k1 == k2 -> hash(k1) == hash(k2)
82+
/// ```
83+
///
84+
/// In other words, if two keys are equal, their hashes should also be equal.
85+
/// `HashMap` and `HashSet` both rely on this behavior.
7686
#[stable(feature = "rust1", since = "1.0.0")]
7787
pub trait Hash {
7888
/// Feeds this value into the state given, updating the hasher as necessary.

src/liblibc/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,10 @@ pub mod types {
307307
#[derive(Copy)] pub struct sockaddr_storage {
308308
pub ss_family: sa_family_t,
309309
pub __ss_align: isize,
310-
pub __ss_pad2: [u8; 128 - 2 * (::core::isize::BYTES as usize)],
310+
#[cfg(target_pointer_width = "32")]
311+
pub __ss_pad2: [u8; 128 - 2 * 4],
312+
#[cfg(target_pointer_width = "64")]
313+
pub __ss_pad2: [u8; 128 - 2 * 8],
311314
}
312315
#[repr(C)]
313316
#[derive(Copy)] pub struct sockaddr_in {

src/libstd/collections/hash/map.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,14 @@ fn test_resize_policy() {
214214
/// overridden with one of the constructors.
215215
///
216216
/// It is required that the keys implement the `Eq` and `Hash` traits, although
217-
/// this can frequently be achieved by using `#[derive(Eq, Hash)]`.
217+
/// this can frequently be achieved by using `#[derive(Eq, Hash)]`. If you
218+
/// implement these yourself, it is important that the following property holds:
219+
///
220+
/// ```text
221+
/// k1 == k2 -> hash(k1) == hash(k2)
222+
/// ```
223+
///
224+
/// In other words, if two keys are equal, their hashes must be equal.
218225
///
219226
/// It is a logic error for a key to be modified in such a way that the key's
220227
/// hash, as determined by the `Hash` trait, or its equality, as determined by

src/libstd/collections/hash/set.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,16 @@ use super::state::HashState;
3434

3535
/// An implementation of a hash set using the underlying representation of a
3636
/// HashMap where the value is (). As with the `HashMap` type, a `HashSet`
37-
/// requires that the elements implement the `Eq` and `Hash` traits.
37+
/// requires that the elements implement the `Eq` and `Hash` traits. This can
38+
/// frequently be achieved by using `#[derive(Eq, Hash)]`. If you implement
39+
/// these yourself, it is important that the following property holds:
40+
///
41+
/// ```text
42+
/// k1 == k2 -> hash(k1) == hash(k2)
43+
/// ```
44+
///
45+
/// In other words, if two keys are equal, their hashes must be equal.
46+
///
3847
///
3948
/// It is a logic error for an item to be modified in such a way that the
4049
/// item's hash, as determined by the `Hash` trait, or its equality, as

0 commit comments

Comments
 (0)