Skip to content

Commit 414de30

Browse files
committed
---
yaml --- r: 195134 b: refs/heads/beta c: d8be84e h: refs/heads/master v: v3
1 parent 2e73ffb commit 414de30

File tree

14 files changed

+140
-236
lines changed

14 files changed

+140
-236
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: 1accaa9f86002e95c1d0a677349ab033ec6dd2e2
34+
refs/heads/beta: d8be84eb4499e21bd98a3500c8760540996df23b
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: be7f6ac7008f8ddf980ac07026b05bdd865f29cc

branches/beta/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]>

branches/beta/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)

branches/beta/src/doc/trpl/documentation.md

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

branches/beta/src/doc/trpl/standard-input.md

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

branches/beta/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];

branches/beta/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.

branches/beta/src/libcore/iter.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,6 +1017,27 @@ impl<'a, I: Iterator + ?Sized> Iterator for &'a mut I {
10171017
built from an iterator over elements of type `{A}`"]
10181018
pub trait FromIterator<A> {
10191019
/// Build a container with elements from something iterable.
1020+
///
1021+
/// # Examples
1022+
///
1023+
/// ```
1024+
/// use std::collections::HashSet;
1025+
/// use std::iter::FromIterator;
1026+
///
1027+
/// let colors_vec = vec!["red", "red", "yellow", "blue"];
1028+
/// let colors_set = HashSet::<&str>::from_iter(colors_vec);
1029+
/// assert_eq!(colors_set.len(), 3);
1030+
/// ```
1031+
///
1032+
/// `FromIterator` is more commonly used implicitly via the `Iterator::collect` method:
1033+
///
1034+
/// ```
1035+
/// use std::collections::HashSet;
1036+
///
1037+
/// let colors_vec = vec!["red", "red", "yellow", "blue"];
1038+
/// let colors_set = colors_vec.into_iter().collect::<HashSet<&str>>();
1039+
/// assert_eq!(colors_set.len(), 3);
1040+
/// ```
10201041
#[stable(feature = "rust1", since = "1.0.0")]
10211042
fn from_iter<T: IntoIterator<Item=A>>(iterator: T) -> Self;
10221043
}

branches/beta/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 {

branches/beta/src/librustdoc/html/render.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ pub struct Implementor {
125125
pub trait_: clean::Type,
126126
pub for_: clean::Type,
127127
pub stability: Option<clean::Stability>,
128+
pub polarity: Option<clean::ImplPolarity>,
128129
}
129130

130131
/// Metadata about implementations for a type.
@@ -635,9 +636,11 @@ fn write_shared(cx: &Context,
635636
// going on). If they're in different crates then the crate defining
636637
// the trait will be interested in our implementation.
637638
if imp.def_id.krate == did.krate { continue }
638-
try!(write!(&mut f, r#""{}impl{} {} for {}","#,
639+
try!(write!(&mut f, r#""{}impl{} {}{} for {}","#,
639640
ConciseStability(&imp.stability),
640-
imp.generics, imp.trait_, imp.for_));
641+
imp.generics,
642+
if imp.polarity == Some(clean::ImplPolarity::Negative) { "!" } else { "" },
643+
imp.trait_, imp.for_));
641644
}
642645
try!(writeln!(&mut f, r"];"));
643646
try!(writeln!(&mut f, "{}", r"
@@ -882,6 +885,7 @@ impl DocFolder for Cache {
882885
trait_: i.trait_.as_ref().unwrap().clone(),
883886
for_: i.for_.clone(),
884887
stability: item.stability.clone(),
888+
polarity: i.polarity.clone(),
885889
});
886890
}
887891
Some(..) | None => {}

branches/beta/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

branches/beta/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)