Skip to content

Commit 366a715

Browse files
committed
---
yaml --- r: 274318 b: refs/heads/stable c: 638555e h: refs/heads/master
1 parent 9b6409b commit 366a715

File tree

105 files changed

+676
-1357
lines changed

Some content is hidden

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

105 files changed

+676
-1357
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: 3e56732322fdfa65e640a5bd89f6f38e45e8312d
32+
refs/heads/stable: 638555e64d0fc66adc30bc57add2fe6f9164483c
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/CONTRIBUTING.md

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ links to the major sections:
66

77
* [Feature Requests](#feature-requests)
88
* [Bug Reports](#bug-reports)
9-
* [The Build System](#the-build-system)
109
* [Pull Requests](#pull-requests)
1110
* [Writing Documentation](#writing-documentation)
1211
* [Issue Triage](#issue-triage)
@@ -78,66 +77,6 @@ to do this is to invoke `rustc` like this:
7877
$ RUST_BACKTRACE=1 rustc ...
7978
```
8079

81-
## The Build System
82-
83-
Rust's build system allows you to bootstrap the compiler, run tests &
84-
benchmarks, generate documentation, install a fresh build of Rust, and more.
85-
It's your best friend when working on Rust, allowing you to compile & test
86-
your contributions before submission.
87-
88-
All the configuration for the build system lives in [the `mk` directory][mkdir]
89-
in the project root. It can be hard to follow in places, as it uses some
90-
advanced Make features which make for some challenging reading. If you have
91-
questions on the build system internals, try asking in
92-
[`#rust-internals`][pound-rust-internals].
93-
94-
[mkdir]: https://github.com/rust-lang/rust/tree/master/mk/
95-
96-
### Configuration
97-
98-
Before you can start building the compiler you need to configure the build for
99-
your system. In most cases, that will just mean using the defaults provided
100-
for Rust. Configuring involves invoking the `configure` script in the project
101-
root.
102-
103-
```
104-
./configure
105-
```
106-
107-
There are large number of options accepted by this script to alter the
108-
configuration used later in the build process. Some options to note:
109-
110-
- `--enable-debug` - Build a debug version of the compiler (disables optimizations)
111-
- `--enable-optimize` - Enable optimizations (can be used with `--enable-debug`
112-
to make a debug build with optimizations)
113-
- `--disable-valgrind-rpass` - Don't run tests with valgrind
114-
- `--enable-clang` - Prefer clang to gcc for building dependencies (e.g., LLVM)
115-
- `--enable-ccache` - Invoke clang/gcc with ccache to re-use object files between builds
116-
- `--enable-compiler-docs` - Build compiler documentation
117-
118-
To see a full list of options, run `./configure --help`.
119-
120-
### Useful Targets
121-
122-
Some common make targets are:
123-
124-
- `make rustc-stage1` - build up to (and including) the first stage. For most
125-
cases we don't need to build the stage2 compiler, so we can save time by not
126-
building it. The stage1 compiler is a fully functioning compiler and
127-
(probably) will be enough to determine if your change works as expected.
128-
- `make check` - build the full compiler & run all tests (takes a while). This
129-
is what gets run by the continuous integration system against your pull
130-
request. You should run this before submitting to make sure your tests pass
131-
& everything builds in the correct manner.
132-
- `make check-stage1-std NO_REBUILD=1` - test the standard library without
133-
rebuilding the entire compiler
134-
- `make check TESTNAME=<path-to-test-file>.rs` - Run a single test file
135-
- `make check-stage1-rpass TESTNAME=<path-to-test-file>.rs` - Run a single
136-
rpass test with the stage1 compiler (this will be quicker than running the
137-
command above as we only build the stage1 compiler, not the entire thing).
138-
You can also leave off the `-rpass` to run all stage1 test types.
139-
- `make check-stage1-coretest` - Run stage1 tests in `libcore`.
140-
14180
## Pull Requests
14281

14382
Pull requests are the primary mechanism we use to change Rust. GitHub itself

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/syntax-index.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Keywords
44

5-
* `as`: primitive casting. See [Casting Between Types (`as`)].
5+
* `as`: primitive casting, or part of UFCS. See [Casting Between Types (`as`)], [Universal Function Call Syntax (Angle-bracket Form)].
66
* `break`: break out of loop. See [Loops (Ending Iteration Early)].
77
* `const`: constant items and constant raw pointers. See [`const` and `static`], [Raw Pointers].
88
* `continue`: continue to next loop iteration. See [Loops (Ending Iteration Early)].
@@ -117,6 +117,9 @@
117117
* `super::path`: path relative to the parent of the current module. See [Crates and Modules (Re-exporting with `pub use`)].
118118
* `type::ident`: associated constants, functions, and types. See [Associated Types].
119119
* `<type>::…`: associated item for a type which cannot be directly named (*e.g.* `<&T>::…`, `<[T]>::…`, *etc.*). See [Associated Types].
120+
* `Trait::method(…)`: disambiguating a method call by naming the trait which defines it. See [Universal Function Call Syntax].
121+
* `Type::method(…)`: disambiguating a method call by naming the type for which it's defined. See [Universal Function Call Syntax].
122+
* `<Type as Trait>::method(…)`: disambiguating a method call by naming the trait _and_ type. See [Universal Function Call Syntax (Angle-bracket Form)].
120123

121124
<!-- Generics -->
122125

@@ -132,8 +135,7 @@
132135
<!-- Constraints -->
133136

134137
* `T: U`: generic parameter `T` constrained to types that implement `U`. See [Traits].
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.
138+
* `T: 'a`: generic type `T` must outlive lifetime `'a`.
137139
* `'b: 'a`: generic lifetime `'b` must outlive lifetime `'a`.
138140
* `T: ?Sized`: allow generic type parameter to be a dynamically-sized type. See [Unsized Types (`?Sized`)].
139141
* `'a + trait`, `trait + trait`: compound type constraint. See [Traits (Multiple Trait Bounds)].
@@ -235,6 +237,8 @@
235237
[Traits (`where` clause)]: traits.html#where-clause
236238
[Traits (Multiple Trait Bounds)]: traits.html#multiple-trait-bounds
237239
[Traits]: traits.html
240+
[Universal Function Call Syntax]: ufcs.html
241+
[Universal Function Call Syntax (Angle-bracket Form)]: ufcs.html#angle-bracket-form
238242
[Unsafe]: unsafe.html
239243
[Unsized Types (`?Sized`)]: unsized-types.html#sized
240244
[Variable Bindings]: variable-bindings.html

branches/stable/src/doc/reference.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2095,7 +2095,7 @@ along with their default settings. [Compiler
20952095
plugins](book/compiler-plugins.html#lint-plugins) can provide additional lint checks.
20962096

20972097
```{.ignore}
2098-
pub mod m1 {
2098+
mod m1 {
20992099
// Missing documentation is ignored here
21002100
#[allow(missing_docs)]
21012101
pub fn undocumented_one() -> i32 { 1 }
@@ -2115,9 +2115,9 @@ check on and off:
21152115

21162116
```{.ignore}
21172117
#[warn(missing_docs)]
2118-
pub mod m2{
2118+
mod m2{
21192119
#[allow(missing_docs)]
2120-
pub mod nested {
2120+
mod nested {
21212121
// Missing documentation is ignored here
21222122
pub fn undocumented_one() -> i32 { 1 }
21232123
@@ -2137,7 +2137,7 @@ that lint check:
21372137

21382138
```{.ignore}
21392139
#[forbid(missing_docs)]
2140-
pub mod m3 {
2140+
mod m3 {
21412141
// Attempting to toggle warning signals an error here
21422142
#[allow(missing_docs)]
21432143
/// Returns 2.

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/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-
let (a, b) = self.as_slices();
1998-
Hash::hash_slice(a, state);
1999-
Hash::hash_slice(b, state);
1997+
for elt in self {
1998+
elt.hash(state);
1999+
}
20002000
}
20012001
}
20022002

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/libcollectionstest/vec_deque.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -605,25 +605,6 @@ 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-
627608
#[test]
628609
fn test_ord() {
629610
let x = VecDeque::new();

0 commit comments

Comments
 (0)