Skip to content

Commit f376225

Browse files
committed
---
yaml --- r: 194783 b: refs/heads/master c: 9147463 h: refs/heads/master i: 194781: 33f5d1e 194779: a9fea49 194775: 3273d32 194767: 93f3695 194751: 77f494d v: v3
1 parent cc9f6f9 commit f376225

File tree

9 files changed

+36
-174
lines changed

9 files changed

+36
-174
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 58c7d6f3e1dc3c09d7362d5dffbecc8d37ad483a
2+
refs/heads/master: 9147463678341db09c36d1a24a643b8ba4e3be73
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 552080181c58beef03493a110b4a38b20b6b5da5
55
refs/heads/try: 961e0358e1a5c0faaef606e31e9965742c1643bf

trunk/AUTHORS.txt

Lines changed: 1 addition & 1 deletion
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]>

trunk/src/doc/trpl/SUMMARY.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* [Looping](looping.md)
1414
* [Strings](strings.md)
1515
* [Arrays, Vectors, and Slices](arrays-vectors-and-slices.md)
16-
* [Standard Input](standard-input.md)
1716
* [Intermediate Rust](intermediate.md)
1817
* [Crates and Modules](crates-and-modules.md)
1918
* [Testing](testing.md)

trunk/src/doc/trpl/standard-input.md

Lines changed: 0 additions & 166 deletions
This file was deleted.

trunk/src/libcollections/slice.rs

Lines changed: 2 additions & 2 deletions
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];

trunk/src/libcore/hash/mod.rs

Lines changed: 10 additions & 0 deletions
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.

trunk/src/liblibc/lib.rs

Lines changed: 4 additions & 1 deletion
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 {

trunk/src/libstd/collections/hash/map.rs

Lines changed: 8 additions & 1 deletion
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

trunk/src/libstd/collections/hash/set.rs

Lines changed: 10 additions & 1 deletion
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)