Skip to content

Commit 6a006a1

Browse files
committed
---
yaml --- r: 274295 b: refs/heads/stable c: 0b511e8 h: refs/heads/master i: 274293: 48f77c8 274291: 359d388 274287: 48ba7cf
1 parent 406ef70 commit 6a006a1

File tree

108 files changed

+1272
-1454
lines changed

Some content is hidden

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

108 files changed

+1272
-1454
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: aba11b3206da1ac0a1eb35ee55f86f059a927832
32+
refs/heads/stable: 0b511e82abe48f40808453de2f013e7c5ebab4c3
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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ 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+
2028
# Macro that generates the full list of dependencies for a crate at a particular
2129
# stage/target/host tuple.
2230
#

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](getting-started.html#hello-cargo) and [Cargo's documentation][14].
1515+
section](../book/hello-cargo.html) 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: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,6 @@ 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-
174170
If not, there are a number of places where we can get help. The easiest is
175171
[the #rust IRC channel on irc.mozilla.org][irc], which we can access through
176172
[Mibbit][mibbit]. Click that link, and we'll be chatting with other Rustaceans
@@ -608,11 +604,11 @@ This chapter covered the basics that will serve you well through the rest of
608604
this book, and the rest of your time with Rust. Now that you’ve got the tools
609605
down, we'll cover more about the Rust language itself.
610606

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

617-
[guessinggame]: guessing-game.html
613+
[learnrust]: learn-rust.html
618614
[syntax]: syntax-and-semantics.html
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
% Learn Rust
2+
3+
Welcome! This chapter has a few tutorials that teach you Rust through building
4+
projects. You’ll get a high-level overview, but we’ll skim over the details.
5+
6+
If you’d prefer a more ‘from the ground up’-style experience, check
7+
out [Syntax and Semantics][ss].
8+
9+
[ss]: syntax-and-semantics.html

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 `break` or `continue` for one
198+
loop. In a situation where you would like to a `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/liballoc/boxed_test.rs

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

18+
use std::boxed;
1819
use std::boxed::Box;
1920

2021
#[test]

branches/stable/src/liballoc/lib.rs

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

7574
#![feature(allocator)]
7675
#![feature(box_syntax)]
7776
#![feature(coerce_unsized)]
78-
#![feature(const_fn)]
7977
#![feature(core_intrinsics)]
8078
#![feature(custom_attribute)]
81-
#![feature(drop_in_place)]
82-
#![feature(dropck_parametricity)]
8379
#![feature(fundamental)]
8480
#![feature(lang_items)]
85-
#![feature(needs_allocator)]
8681
#![feature(optin_builtin_traits)]
8782
#![feature(placement_in_syntax)]
83+
#![feature(placement_new_protocol)]
84+
#![feature(raw)]
8885
#![feature(shared)]
8986
#![feature(staged_api)]
9087
#![feature(unboxed_closures)]
9188
#![feature(unique)]
9289
#![feature(unsafe_no_drop_flag, filling_drop)]
90+
#![feature(dropck_parametricity)]
9391
#![feature(unsize)]
92+
#![feature(drop_in_place)]
93+
#![feature(fn_traits)]
94+
#![feature(const_fn)]
95+
96+
#![feature(needs_allocator)]
9497

9598
// Issue# 30592: Systematically use alloc_system during stage0 since jemalloc
9699
// might be unavailable or disabled
97100
#![cfg_attr(stage0, feature(alloc_system))]
98101

99-
#![cfg_attr(not(test), feature(raw, fn_traits, placement_new_protocol))]
100102
#![cfg_attr(test, feature(test, rustc_private, box_heap))]
101103

102104
#[cfg(stage0)]

branches/stable/src/liballoc_jemalloc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
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))]
2019
#![feature(allocator)]
2120
#![feature(libc)]
2221
#![feature(staged_api)]

branches/stable/src/liballoc_system/lib.rs

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

branches/stable/src/libarena/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
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))]
3130

3231
#![feature(alloc)]
3332
#![feature(core_intrinsics)]

branches/stable/src/libcollections/lib.rs

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

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

3332
#![feature(alloc)]
3433
#![feature(box_patterns)]
@@ -56,7 +55,7 @@
5655
#![feature(unicode)]
5756
#![feature(unique)]
5857
#![feature(unsafe_no_drop_flag)]
59-
#![cfg_attr(test, feature(rand, test))]
58+
#![cfg_attr(test, feature(clone_from_slice, rand, test))]
6059

6160
#![no_std]
6261

branches/stable/src/libcollections/slice.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,20 @@
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-
#![cfg_attr(test, allow(unused_imports, dead_code))]
86+
#![allow(unused_imports)]
8787

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

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

135146
#[cfg(test)]
136147
use string::ToString;

branches/stable/src/libcollections/str.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
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;
2226
use core::str as core_str;
2327
use core::str::pattern::Pattern;
2428
use core::str::pattern::{Searcher, ReverseSearcher, DoubleEndedSearcher};

branches/stable/src/libcollectionstest/slice.rs

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

1111
use std::cmp::Ordering::{Equal, Greater, Less};
12+
use std::default::Default;
1213
use std::mem;
1314
use std::__rand::{Rng, thread_rng};
1415
use std::rc::Rc;

branches/stable/src/libcore/cell.rs

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

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

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

7474
use prelude::v1::*;
7575

76-
use marker;
7776
use mem;
7877

7978
#[stable(feature = "rust1", since = "1.0.0")]
@@ -191,77 +190,6 @@ pub trait Hasher {
191190
}
192191
}
193192

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-
265193
//////////////////////////////////////////////////////////////////////////////
266194

267195
mod impls {

branches/stable/src/libcore/iter.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2740,13 +2740,7 @@ pub trait Extend<A> {
27402740
/// It is important to note that both back and forth work on the same range,
27412741
/// and do not cross: iteration is over when they meet in the middle.
27422742
///
2743-
/// In a similar fashion to the [`Iterator`] protocol, once a
2744-
/// `DoubleEndedIterator` returns `None` from a `next_back()`, calling it again
2745-
/// may or may not ever return `Some` again. `next()` and `next_back()` are
2746-
/// interchangable for this purpose.
2747-
///
27482743
/// [`Iterator`]: trait.Iterator.html
2749-
///
27502744
/// # Examples
27512745
///
27522746
/// Basic usage:
@@ -4252,15 +4246,13 @@ impl<A: Step> RangeFrom<A> {
42524246
///
42534247
/// # Examples
42544248
///
4255-
/// ```
4256-
/// # #![feature(step_by)]
4257-
///
4258-
/// for i in (0u8..).step_by(2).take(10) {
4249+
/// ```ignore
4250+
/// for i in (0u8..).step_by(2) {
42594251
/// println!("{}", i);
42604252
/// }
42614253
/// ```
42624254
///
4263-
/// This prints the first ten even natural integers (0 to 18).
4255+
/// This prints all even `u8` values.
42644256
#[unstable(feature = "step_by", reason = "recent addition",
42654257
issue = "27741")]
42664258
pub fn step_by(self, by: A) -> StepBy<A, Self> {

branches/stable/src/libcore/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656

5757
#![no_core]
5858
#![deny(missing_docs)]
59-
#![cfg_attr(not(stage0), deny(warnings))]
6059

6160
#![feature(allow_internal_unstable)]
6261
#![feature(associated_type_defaults)]

branches/stable/src/libflate/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
2323
html_root_url = "https://doc.rust-lang.org/nightly/",
2424
test(attr(deny(warnings))))]
25-
#![cfg_attr(not(stage0), deny(warnings))]
2625

2726
#![feature(libc)]
2827
#![feature(staged_api)]

branches/stable/src/libfmt_macros/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
html_root_url = "https://doc.rust-lang.org/nightly/",
2424
html_playground_url = "https://play.rust-lang.org/",
2525
test(attr(deny(warnings))))]
26-
#![cfg_attr(not(stage0), deny(warnings))]
2726

2827
#![feature(staged_api)]
2928
#![feature(unicode)]

branches/stable/src/libgraphviz/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@
280280
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
281281
html_root_url = "https://doc.rust-lang.org/nightly/",
282282
test(attr(allow(unused_variables), deny(warnings))))]
283-
#![cfg_attr(not(stage0), deny(warnings))]
284283

285284
#![feature(str_escape)]
286285

branches/stable/src/liblog/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@
168168
html_playground_url = "https://play.rust-lang.org/",
169169
test(attr(deny(warnings))))]
170170
#![deny(missing_docs)]
171-
#![cfg_attr(not(stage0), deny(warnings))]
172171

173172
#![feature(box_syntax)]
174173
#![feature(const_fn)]

0 commit comments

Comments
 (0)