Skip to content

Commit d46fbad

Browse files
committed
---
yaml --- r: 274315 b: refs/heads/stable c: cb3680c h: refs/heads/master i: 274313: bc43870 274311: 2ce0c42
1 parent 33862c8 commit d46fbad

File tree

158 files changed

+2361
-1651
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+2361
-1651
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 05f7b59352abe51f4b1b4897dfcdae7feb33a3a3
32+
refs/heads/stable: cb3680c08028e4cfe241cf7e68a5d8d6e5dbd2d7
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/mk/target.mk

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,6 @@ export CFG_COMPILER_HOST_TRIPLE
1717
export CFG_DEFAULT_LINKER
1818
export CFG_DEFAULT_AR
1919

20-
# The standard libraries should be held up to a higher standard than any old
21-
# code, make sure that these common warnings are denied by default. These can
22-
# be overridden during development temporarily. For stage0, we allow warnings
23-
# which may be bugs in stage0 (should be fixed in stage1+)
24-
RUST_LIB_FLAGS_ST0 += -W warnings
25-
RUST_LIB_FLAGS_ST1 += -D warnings
26-
RUST_LIB_FLAGS_ST2 += -D warnings
27-
2820
# Macro that generates the full list of dependencies for a crate at a particular
2921
# stage/target/host tuple.
3022
#

branches/stable/src/doc/book/error-handling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1512,7 +1512,7 @@ and [`rustc-serialize`](https://crates.io/crates/rustc-serialize) crates.
15121512

15131513
We're not going to spend a lot of time on setting up a project with
15141514
Cargo because it is already covered well in [the Cargo
1515-
section](../book/hello-cargo.html) and [Cargo's documentation][14].
1515+
section](getting-started.html#hello-cargo) and [Cargo's documentation][14].
15161516

15171517
To get started from scratch, run `cargo new --bin city-pop` and make sure your
15181518
`Cargo.toml` looks something like this:

branches/stable/src/doc/book/getting-started.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ variable. If it isn't, run the installer again, select "Change" on the "Change,
167167
repair, or remove installation" page and ensure "Add to PATH" is installed on
168168
the local hard drive.
169169

170+
Rust does not do its own linking, and so you’ll need to have a linker
171+
installed. Doing so will depend on your specific system, consult its
172+
documentation for more details.
173+
170174
If not, there are a number of places where we can get help. The easiest is
171175
[the #rust IRC channel on irc.mozilla.org][irc], which we can access through
172176
[Mibbit][mibbit]. Click that link, and we'll be chatting with other Rustaceans
@@ -604,11 +608,11 @@ This chapter covered the basics that will serve you well through the rest of
604608
this book, and the rest of your time with Rust. Now that you’ve got the tools
605609
down, we'll cover more about the Rust language itself.
606610

607-
You have two options: Dive into a project with ‘[Learn Rust][learnrust]’, or
611+
You have two options: Dive into a project with ‘[Tutorial: Guessing Game][guessinggame]’, or
608612
start from the bottom and work your way up with ‘[Syntax and
609613
Semantics][syntax]’. More experienced systems programmers will probably prefer
610-
Learn Rust’, while those from dynamic backgrounds may enjoy either. Different
614+
Tutorial: Guessing Game’, while those from dynamic backgrounds may enjoy either. Different
611615
people learn differently! Choose whatever’s right for you.
612616

613-
[learnrust]: learn-rust.html
617+
[guessinggame]: guessing-game.html
614618
[syntax]: syntax-and-semantics.html

branches/stable/src/doc/book/learn-rust.md

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

branches/stable/src/doc/book/loops.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ for x in 0..10 {
195195
You may also encounter situations where you have nested loops and need to
196196
specify which one your `break` or `continue` statement is for. Like most
197197
other languages, by default a `break` or `continue` will apply to innermost
198-
loop. In a situation where you would like to a `break` or `continue` for one
198+
loop. In a situation where you would like to `break` or `continue` for one
199199
of the outer loops, you can use labels to specify which loop the `break` or
200200
`continue` statement applies to. This will only print when both `x` and `y` are
201201
odd:

branches/stable/src/doc/book/syntax-index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@
132132
<!-- Constraints -->
133133

134134
* `T: U`: generic parameter `T` constrained to types that implement `U`. See [Traits].
135-
* `T: 'a`: generic type `T` must outlive lifetime `'a`.
135+
* `T: 'a`: generic type `T` must outlive lifetime `'a`. When we say that a type 'outlives' the lifetime, we mean that it cannot transitively contain any references with lifetimes shorter than `'a`.
136+
* `T : 'static`: The generic type `T` contains no borrowed references other than `'static` ones.
136137
* `'b: 'a`: generic lifetime `'b` must outlive lifetime `'a`.
137138
* `T: ?Sized`: allow generic type parameter to be a dynamically-sized type. See [Unsized Types (`?Sized`)].
138139
* `'a + trait`, `trait + trait`: compound type constraint. See [Traits (Multiple Trait Bounds)].

branches/stable/src/liballoc/boxed_test.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use core::ops::Deref;
1515
use core::result::Result::{Ok, Err};
1616
use core::clone::Clone;
1717

18-
use std::boxed;
1918
use std::boxed::Box;
2019

2120
#[test]

branches/stable/src/liballoc/lib.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,35 +70,33 @@
7070
test(no_crate_inject, attr(allow(unused_variables), deny(warnings))))]
7171
#![no_std]
7272
#![needs_allocator]
73+
#![cfg_attr(not(stage0), deny(warnings))]
7374

7475
#![feature(allocator)]
7576
#![feature(box_syntax)]
7677
#![feature(coerce_unsized)]
78+
#![feature(const_fn)]
7779
#![feature(core_intrinsics)]
7880
#![feature(custom_attribute)]
81+
#![feature(drop_in_place)]
82+
#![feature(dropck_parametricity)]
7983
#![feature(fundamental)]
8084
#![feature(lang_items)]
85+
#![feature(needs_allocator)]
8186
#![feature(optin_builtin_traits)]
8287
#![feature(placement_in_syntax)]
83-
#![feature(placement_new_protocol)]
84-
#![feature(raw)]
8588
#![feature(shared)]
8689
#![feature(staged_api)]
8790
#![feature(unboxed_closures)]
8891
#![feature(unique)]
8992
#![feature(unsafe_no_drop_flag, filling_drop)]
90-
#![feature(dropck_parametricity)]
9193
#![feature(unsize)]
92-
#![feature(drop_in_place)]
93-
#![feature(fn_traits)]
94-
#![feature(const_fn)]
95-
96-
#![feature(needs_allocator)]
9794

9895
// Issue# 30592: Systematically use alloc_system during stage0 since jemalloc
9996
// might be unavailable or disabled
10097
#![cfg_attr(stage0, feature(alloc_system))]
10198

99+
#![cfg_attr(not(test), feature(raw, fn_traits, placement_new_protocol))]
102100
#![cfg_attr(test, feature(test, rustc_private, box_heap))]
103101

104102
#[cfg(stage0)]

branches/stable/src/liballoc_jemalloc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
reason = "this library is unlikely to be stabilized in its current \
1717
form or name",
1818
issue = "27783")]
19+
#![cfg_attr(not(stage0), deny(warnings))]
1920
#![feature(allocator)]
2021
#![feature(libc)]
2122
#![feature(staged_api)]

branches/stable/src/liballoc_system/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#![crate_type = "rlib"]
1313
#![no_std]
1414
#![allocator]
15+
#![cfg_attr(not(stage0), deny(warnings))]
1516
#![unstable(feature = "alloc_system",
1617
reason = "this library is unlikely to be stabilized in its current \
1718
form or name",

branches/stable/src/libarena/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
2828
html_root_url = "https://doc.rust-lang.org/nightly/",
2929
test(no_crate_inject, attr(deny(warnings))))]
30+
#![cfg_attr(not(stage0), deny(warnings))]
3031

3132
#![feature(alloc)]
3233
#![feature(core_intrinsics)]

branches/stable/src/libcollections/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
#![allow(trivial_casts)]
3030
#![cfg_attr(test, allow(deprecated))] // rand
31+
#![cfg_attr(not(stage0), deny(warnings))]
3132

3233
#![feature(alloc)]
3334
#![feature(box_patterns)]
@@ -55,7 +56,7 @@
5556
#![feature(unicode)]
5657
#![feature(unique)]
5758
#![feature(unsafe_no_drop_flag)]
58-
#![cfg_attr(test, feature(clone_from_slice, rand, test))]
59+
#![cfg_attr(test, feature(rand, test))]
5960

6061
#![no_std]
6162

branches/stable/src/libcollections/slice.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -83,20 +83,14 @@
8383

8484
// Many of the usings in this module are only used in the test configuration.
8585
// It's cleaner to just turn off the unused_imports warning than to fix them.
86-
#![allow(unused_imports)]
86+
#![cfg_attr(test, allow(unused_imports, dead_code))]
8787

8888
use alloc::boxed::Box;
89-
use core::clone::Clone;
9089
use core::cmp::Ordering::{self, Greater, Less};
91-
use core::cmp::{self, Ord, PartialEq};
92-
use core::iter::Iterator;
93-
use core::marker::Sized;
90+
use core::cmp;
9491
use core::mem::size_of;
9592
use core::mem;
96-
use core::ops::FnMut;
97-
use core::option::Option::{self, Some, None};
9893
use core::ptr;
99-
use core::result::Result;
10094
use core::slice as core_slice;
10195

10296
use borrow::{Borrow, BorrowMut, ToOwned};
@@ -136,12 +130,7 @@ pub use self::hack::to_vec;
136130
// `test_permutations` test
137131
mod hack {
138132
use alloc::boxed::Box;
139-
use core::clone::Clone;
140-
#[cfg(test)]
141-
use core::iter::Iterator;
142133
use core::mem;
143-
#[cfg(test)]
144-
use core::option::Option::{Some, None};
145134

146135
#[cfg(test)]
147136
use string::ToString;

branches/stable/src/libcollections/str.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919
// It's cleaner to just turn off the unused_imports warning than to fix them.
2020
#![allow(unused_imports)]
2121

22-
use core::clone::Clone;
23-
use core::iter::{Iterator, Extend};
24-
use core::option::Option::{self, Some, None};
25-
use core::result::Result;
2622
use core::str as core_str;
2723
use core::str::pattern::Pattern;
2824
use core::str::pattern::{Searcher, ReverseSearcher, DoubleEndedSearcher};

branches/stable/src/libcollections/vec_deque.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1994,9 +1994,9 @@ impl<A: Ord> Ord for VecDeque<A> {
19941994
impl<A: Hash> Hash for VecDeque<A> {
19951995
fn hash<H: Hasher>(&self, state: &mut H) {
19961996
self.len().hash(state);
1997-
for elt in self {
1998-
elt.hash(state);
1999-
}
1997+
let (a, b) = self.as_slices();
1998+
Hash::hash_slice(a, state);
1999+
Hash::hash_slice(b, state);
20002000
}
20012001
}
20022002

branches/stable/src/libcollectionstest/slice.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// except according to those terms.
1010

1111
use std::cmp::Ordering::{Equal, Greater, Less};
12-
use std::default::Default;
1312
use std::mem;
1413
use std::__rand::{Rng, thread_rng};
1514
use std::rc::Rc;

branches/stable/src/libcollectionstest/vec_deque.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,25 @@ fn test_hash() {
605605
assert!(::hash(&x) == ::hash(&y));
606606
}
607607

608+
#[test]
609+
fn test_hash_after_rotation() {
610+
// test that two deques hash equal even if elements are laid out differently
611+
let len = 28;
612+
let mut ring: VecDeque<i32> = (0..len as i32).collect();
613+
let orig = ring.clone();
614+
for _ in 0..ring.capacity() {
615+
// shift values 1 step to the right by pop, sub one, push
616+
ring.pop_front();
617+
for elt in &mut ring {
618+
*elt -= 1;
619+
}
620+
ring.push_back(len - 1);
621+
assert_eq!(::hash(&orig), ::hash(&ring));
622+
assert_eq!(orig, ring);
623+
assert_eq!(ring, orig);
624+
}
625+
}
626+
608627
#[test]
609628
fn test_ord() {
610629
let x = VecDeque::new();

branches/stable/src/libcore/cell.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,9 @@ impl<T: ?Sized> RefCell<T> {
414414
///
415415
/// let c = RefCell::new(5);
416416
///
417-
/// let borrowed_five = c.borrow_mut();
417+
/// *c.borrow_mut() = 7;
418+
///
419+
/// assert_eq!(*c.borrow(), 7);
418420
/// ```
419421
///
420422
/// An example of panic:

branches/stable/src/libcore/hash/mod.rs

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373

7474
use prelude::v1::*;
7575

76+
use marker;
7677
use mem;
7778

7879
#[stable(feature = "rust1", since = "1.0.0")]
@@ -190,6 +191,77 @@ pub trait Hasher {
190191
}
191192
}
192193

194+
/// A `BuildHasher` is typically used as a factory for instances of `Hasher`
195+
/// which a `HashMap` can then use to hash keys independently.
196+
///
197+
/// Note that for each instance of `BuildHasher` the create hashers should be
198+
/// identical. That is if the same stream of bytes is fed into each hasher the
199+
/// same output will also be generated.
200+
#[stable(since = "1.7.0", feature = "build_hasher")]
201+
pub trait BuildHasher {
202+
/// Type of the hasher that will be created.
203+
#[stable(since = "1.7.0", feature = "build_hasher")]
204+
type Hasher: Hasher;
205+
206+
/// Creates a new hasher.
207+
#[stable(since = "1.7.0", feature = "build_hasher")]
208+
fn build_hasher(&self) -> Self::Hasher;
209+
}
210+
211+
/// A structure which implements `BuildHasher` for all `Hasher` types which also
212+
/// implement `Default`.
213+
///
214+
/// This struct is 0-sized and does not need construction.
215+
#[stable(since = "1.7.0", feature = "build_hasher")]
216+
pub struct BuildHasherDefault<H>(marker::PhantomData<H>);
217+
218+
#[stable(since = "1.7.0", feature = "build_hasher")]
219+
impl<H: Default + Hasher> BuildHasher for BuildHasherDefault<H> {
220+
type Hasher = H;
221+
222+
fn build_hasher(&self) -> H {
223+
H::default()
224+
}
225+
}
226+
227+
#[stable(since = "1.7.0", feature = "build_hasher")]
228+
impl<H> Clone for BuildHasherDefault<H> {
229+
fn clone(&self) -> BuildHasherDefault<H> {
230+
BuildHasherDefault(marker::PhantomData)
231+
}
232+
}
233+
234+
#[stable(since = "1.7.0", feature = "build_hasher")]
235+
impl<H> Default for BuildHasherDefault<H> {
236+
fn default() -> BuildHasherDefault<H> {
237+
BuildHasherDefault(marker::PhantomData)
238+
}
239+
}
240+
241+
// The HashState trait is super deprecated, but it's here to have the blanket
242+
// impl that goes from HashState -> BuildHasher
243+
244+
/// Deprecated, renamed to `BuildHasher`
245+
#[unstable(feature = "hashmap_hasher", reason = "hasher stuff is unclear",
246+
issue = "27713")]
247+
#[rustc_deprecated(since = "1.7.0", reason = "support moved to std::hash and \
248+
renamed to BuildHasher")]
249+
pub trait HashState {
250+
/// Type of the hasher that will be created.
251+
type Hasher: Hasher;
252+
253+
/// Creates a new hasher based on the given state of this object.
254+
fn hasher(&self) -> Self::Hasher;
255+
}
256+
257+
#[unstable(feature = "hashmap_hasher", reason = "hasher stuff is unclear",
258+
issue = "27713")]
259+
#[allow(deprecated)]
260+
impl<T: HashState> BuildHasher for T {
261+
type Hasher = T::Hasher;
262+
fn build_hasher(&self) -> T::Hasher { self.hasher() }
263+
}
264+
193265
//////////////////////////////////////////////////////////////////////////////
194266

195267
mod impls {

0 commit comments

Comments
 (0)