Skip to content

Commit 270a677

Browse files
committed
Auto merge of #23107 - Manishearth:rollup, r=alexcrichton
2 parents 4d716de + aed31ee commit 270a677

File tree

115 files changed

+1233
-400
lines changed

Some content is hidden

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

115 files changed

+1233
-400
lines changed

mk/main.mk

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ CFG_RELEASE_NUM=1.0.0
1818
# An optional number to put after the label, e.g. '.2' -> '-beta.2'
1919
# NB Make sure it starts with a dot to conform to semver pre-release
2020
# versions (section 9)
21-
CFG_PRERELEASE_VERSION=.2
21+
CFG_PRERELEASE_VERSION=
2222

2323
CFG_FILENAME_EXTRA=4e7c5e5c
2424

@@ -30,8 +30,8 @@ CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)
3030
CFG_DISABLE_UNSTABLE_FEATURES=1
3131
endif
3232
ifeq ($(CFG_RELEASE_CHANNEL),beta)
33-
CFG_RELEASE=$(CFG_RELEASE_NUM)-alpha$(CFG_PRERELEASE_VERSION)
34-
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-alpha$(CFG_PRERELEASE_VERSION)
33+
CFG_RELEASE=$(CFG_RELEASE_NUM)-beta(CFG_PRERELEASE_VERSION)
34+
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-beta(CFG_PRERELEASE_VERSION)
3535
CFG_DISABLE_UNSTABLE_FEATURES=1
3636
endif
3737
ifeq ($(CFG_RELEASE_CHANNEL),nightly)

mk/tests.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ TEST_SREQ$(1)_T_$(2)_H_$(3) = \
590590

591591
# The tests select when to use debug configuration on their own;
592592
# remove directive, if present, from CFG_RUSTC_FLAGS (issue #7898).
593-
CTEST_RUSTC_FLAGS := $$(subst --cfg ndebug,,$$(CFG_RUSTC_FLAGS))
593+
CTEST_RUSTC_FLAGS := $$(subst -C debug-assertions,,$$(CFG_RUSTC_FLAGS))
594594

595595
# The tests cannot be optimized while the rest of the compiler is optimized, so
596596
# filter out the optimization (if any) from rustc and then figure out if we need

src/compiletest/compiletest.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@
2222
#![feature(unicode)]
2323
#![feature(core)]
2424
#![feature(path)]
25-
#![feature(os)]
2625
#![feature(io)]
27-
#![feature(fs)]
2826
#![feature(net)]
27+
#![feature(path_ext)]
2928

3029
#![deny(warnings)]
3130

src/compiletest/runtest.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use procsrv;
2020
use util::logv;
2121

2222
use std::env;
23-
use std::ffi::OsStr;
2423
use std::fmt;
2524
use std::fs::{self, File};
2625
use std::io::BufReader;
@@ -1323,7 +1322,7 @@ fn make_exe_name(config: &Config, testfile: &Path) -> PathBuf {
13231322
let mut f = output_base_name(config, testfile);
13241323
if !env::consts::EXE_SUFFIX.is_empty() {
13251324
let mut fname = f.file_name().unwrap().to_os_string();
1326-
fname.push_os_str(OsStr::from_str(env::consts::EXE_SUFFIX));
1325+
fname.push(env::consts::EXE_SUFFIX);
13271326
f.set_file_name(&fname);
13281327
}
13291328
f
@@ -1433,7 +1432,7 @@ fn make_out_name(config: &Config, testfile: &Path, extension: &str) -> PathBuf {
14331432
fn aux_output_dir_name(config: &Config, testfile: &Path) -> PathBuf {
14341433
let f = output_base_name(config, testfile);
14351434
let mut fname = f.file_name().unwrap().to_os_string();
1436-
fname.push_os_str(OsStr::from_str("libaux"));
1435+
fname.push("libaux");
14371436
f.with_file_name(&fname)
14381437
}
14391438

@@ -1647,8 +1646,8 @@ fn append_suffix_to_stem(p: &Path, suffix: &str) -> PathBuf {
16471646
p.to_path_buf()
16481647
} else {
16491648
let mut stem = p.file_stem().unwrap().to_os_string();
1650-
stem.push_os_str(OsStr::from_str("-"));
1651-
stem.push_os_str(OsStr::from_str(suffix));
1649+
stem.push("-");
1650+
stem.push(suffix);
16521651
p.with_file_name(&stem)
16531652
}
16541653
}

src/doc/guide-tasks.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
% The (old) Rust Threads and Communication Guide
22

33
This content has moved into
4-
[the Rust Programming Language book](book/tasks.html).
4+
[the Rust Programming Language book](book/concurrency.html).

src/doc/trpl/arrays-vectors-and-slices.md

+6
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ let v = vec![1, 2, 3]; // v: Vec<i32>
6060
brackets `[]` with `vec!`. Rust allows you to use either in either situation,
6161
this is just convention.)
6262

63+
There's an alternate form of `vec!` for repeating an initial value:
64+
65+
```
66+
let v = vec![0; 10]; // ten zeroes
67+
```
68+
6369
You can get the length of, iterate over, and subscript vectors just like
6470
arrays. In addition, (mutable) vectors can grow automatically:
6571

src/liballoc/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656
//! The [`heap`](heap/index.html) module defines the low-level interface to the
5757
//! default global allocator. It is not compatible with the libc allocator API.
5858
59+
// Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364)
60+
#![cfg_attr(stage0, feature(custom_attribute))]
5961
#![crate_name = "alloc"]
6062
#![unstable(feature = "alloc")]
6163
#![feature(staged_api)]

src/libarena/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
//! arena but can only hold objects of a single type, and `Arena`, which is a
2020
//! more complex, slower arena which can hold objects of any type.
2121
22+
// Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364)
23+
#![cfg_attr(stage0, feature(custom_attribute))]
2224
#![crate_name = "arena"]
2325
#![unstable(feature = "rustc_private")]
2426
#![staged_api]

src/libcollections/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
//!
1313
//! See [std::collections](../std/collections) for a detailed discussion of collections in Rust.
1414
15-
15+
// Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364)
16+
#![cfg_attr(stage0, feature(custom_attribute))]
1617
#![crate_name = "collections"]
1718
#![unstable(feature = "collections")]
1819
#![staged_api]

src/libcollections/str.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ pub trait StrExt: Index<RangeFull, Output = str> {
10861086
///
10871087
/// let s = "中华Việt Nam";
10881088
/// let mut i = s.len();
1089-
/// while i < 0 {
1089+
/// while i > 0 {
10901090
/// let CharRange {ch, next} = s.char_range_at_reverse(i);
10911091
/// println!("{}: {}", i, ch);
10921092
/// i = next;

src/libcore/iter.rs

+48-46
Original file line numberDiff line numberDiff line change
@@ -1279,14 +1279,14 @@ pub struct Cloned<I> {
12791279
}
12801280

12811281
#[stable(feature = "rust1", since = "1.0.0")]
1282-
impl<T, D, I> Iterator for Cloned<I> where
1283-
T: Clone,
1284-
D: Deref<Target=T>,
1285-
I: Iterator<Item=D>,
1282+
impl<I> Iterator for Cloned<I> where
1283+
I: Iterator,
1284+
I::Item: Deref,
1285+
<I::Item as Deref>::Target: Clone
12861286
{
1287-
type Item = T;
1287+
type Item = <I::Item as Deref>::Target;
12881288

1289-
fn next(&mut self) -> Option<T> {
1289+
fn next(&mut self) -> Option<<Self as Iterator>::Item> {
12901290
self.it.next().cloned()
12911291
}
12921292

@@ -1296,36 +1296,36 @@ impl<T, D, I> Iterator for Cloned<I> where
12961296
}
12971297

12981298
#[stable(feature = "rust1", since = "1.0.0")]
1299-
impl<T, D, I> DoubleEndedIterator for Cloned<I> where
1300-
T: Clone,
1301-
D: Deref<Target=T>,
1302-
I: DoubleEndedIterator<Item=D>,
1299+
impl<I> DoubleEndedIterator for Cloned<I> where
1300+
I: DoubleEndedIterator,
1301+
I::Item: Deref,
1302+
<I::Item as Deref>::Target: Clone
13031303
{
1304-
fn next_back(&mut self) -> Option<T> {
1304+
fn next_back(&mut self) -> Option<<Self as Iterator>::Item> {
13051305
self.it.next_back().cloned()
13061306
}
13071307
}
13081308

13091309
#[stable(feature = "rust1", since = "1.0.0")]
1310-
impl<T, D, I> ExactSizeIterator for Cloned<I> where
1311-
T: Clone,
1312-
D: Deref<Target=T>,
1313-
I: ExactSizeIterator<Item=D>,
1310+
impl<I> ExactSizeIterator for Cloned<I> where
1311+
I: ExactSizeIterator,
1312+
I::Item: Deref,
1313+
<I::Item as Deref>::Target: Clone
13141314
{}
13151315

13161316
#[unstable(feature = "core", reason = "trait is experimental")]
1317-
impl<T, D, I> RandomAccessIterator for Cloned<I> where
1318-
T: Clone,
1319-
D: Deref<Target=T>,
1320-
I: RandomAccessIterator<Item=D>
1317+
impl<I> RandomAccessIterator for Cloned<I> where
1318+
I: RandomAccessIterator,
1319+
I::Item: Deref,
1320+
<I::Item as Deref>::Target: Clone
13211321
{
13221322
#[inline]
13231323
fn indexable(&self) -> usize {
13241324
self.it.indexable()
13251325
}
13261326

13271327
#[inline]
1328-
fn idx(&mut self, index: usize) -> Option<T> {
1328+
fn idx(&mut self, index: usize) -> Option<<Self as Iterator>::Item> {
13291329
self.it.idx(index).cloned()
13301330
}
13311331
}
@@ -1400,11 +1400,14 @@ pub struct Chain<A, B> {
14001400
}
14011401

14021402
#[stable(feature = "rust1", since = "1.0.0")]
1403-
impl<T, A, B> Iterator for Chain<A, B> where A: Iterator<Item=T>, B: Iterator<Item=T> {
1404-
type Item = T;
1403+
impl<A, B> Iterator for Chain<A, B> where
1404+
A: Iterator,
1405+
B: Iterator<Item = A::Item>
1406+
{
1407+
type Item = A::Item;
14051408

14061409
#[inline]
1407-
fn next(&mut self) -> Option<T> {
1410+
fn next(&mut self) -> Option<A::Item> {
14081411
if self.flag {
14091412
self.b.next()
14101413
} else {
@@ -1434,12 +1437,12 @@ impl<T, A, B> Iterator for Chain<A, B> where A: Iterator<Item=T>, B: Iterator<It
14341437
}
14351438

14361439
#[stable(feature = "rust1", since = "1.0.0")]
1437-
impl<T, A, B> DoubleEndedIterator for Chain<A, B> where
1438-
A: DoubleEndedIterator<Item=T>,
1439-
B: DoubleEndedIterator<Item=T>,
1440+
impl<A, B> DoubleEndedIterator for Chain<A, B> where
1441+
A: DoubleEndedIterator,
1442+
B: DoubleEndedIterator<Item=A::Item>,
14401443
{
14411444
#[inline]
1442-
fn next_back(&mut self) -> Option<T> {
1445+
fn next_back(&mut self) -> Option<A::Item> {
14431446
match self.b.next_back() {
14441447
Some(x) => Some(x),
14451448
None => self.a.next_back()
@@ -1448,9 +1451,9 @@ impl<T, A, B> DoubleEndedIterator for Chain<A, B> where
14481451
}
14491452

14501453
#[unstable(feature = "core", reason = "trait is experimental")]
1451-
impl<T, A, B> RandomAccessIterator for Chain<A, B> where
1452-
A: RandomAccessIterator<Item=T>,
1453-
B: RandomAccessIterator<Item=T>,
1454+
impl<A, B> RandomAccessIterator for Chain<A, B> where
1455+
A: RandomAccessIterator,
1456+
B: RandomAccessIterator<Item = A::Item>,
14541457
{
14551458
#[inline]
14561459
fn indexable(&self) -> usize {
@@ -1459,7 +1462,7 @@ impl<T, A, B> RandomAccessIterator for Chain<A, B> where
14591462
}
14601463

14611464
#[inline]
1462-
fn idx(&mut self, index: usize) -> Option<T> {
1465+
fn idx(&mut self, index: usize) -> Option<A::Item> {
14631466
let len = self.a.indexable();
14641467
if index < len {
14651468
self.a.idx(index)
@@ -1479,14 +1482,12 @@ pub struct Zip<A, B> {
14791482
}
14801483

14811484
#[stable(feature = "rust1", since = "1.0.0")]
1482-
impl<T, U, A, B> Iterator for Zip<A, B> where
1483-
A: Iterator<Item = T>,
1484-
B: Iterator<Item = U>,
1485+
impl<A, B> Iterator for Zip<A, B> where A: Iterator, B: Iterator
14851486
{
1486-
type Item = (T, U);
1487+
type Item = (A::Item, B::Item);
14871488

14881489
#[inline]
1489-
fn next(&mut self) -> Option<(T, U)> {
1490+
fn next(&mut self) -> Option<(A::Item, B::Item)> {
14901491
match self.a.next() {
14911492
None => None,
14921493
Some(x) => match self.b.next() {
@@ -1515,12 +1516,12 @@ impl<T, U, A, B> Iterator for Zip<A, B> where
15151516
}
15161517

15171518
#[stable(feature = "rust1", since = "1.0.0")]
1518-
impl<T, U, A, B> DoubleEndedIterator for Zip<A, B> where
1519-
A: DoubleEndedIterator + ExactSizeIterator<Item=T>,
1520-
B: DoubleEndedIterator + ExactSizeIterator<Item=U>,
1519+
impl<A, B> DoubleEndedIterator for Zip<A, B> where
1520+
A: DoubleEndedIterator + ExactSizeIterator,
1521+
B: DoubleEndedIterator + ExactSizeIterator,
15211522
{
15221523
#[inline]
1523-
fn next_back(&mut self) -> Option<(T, U)> {
1524+
fn next_back(&mut self) -> Option<(A::Item, B::Item)> {
15241525
let a_sz = self.a.len();
15251526
let b_sz = self.b.len();
15261527
if a_sz != b_sz {
@@ -1540,17 +1541,17 @@ impl<T, U, A, B> DoubleEndedIterator for Zip<A, B> where
15401541
}
15411542

15421543
#[unstable(feature = "core", reason = "trait is experimental")]
1543-
impl<T, U, A, B> RandomAccessIterator for Zip<A, B> where
1544-
A: RandomAccessIterator<Item=T>,
1545-
B: RandomAccessIterator<Item=U>,
1544+
impl<A, B> RandomAccessIterator for Zip<A, B> where
1545+
A: RandomAccessIterator,
1546+
B: RandomAccessIterator
15461547
{
15471548
#[inline]
15481549
fn indexable(&self) -> usize {
15491550
cmp::min(self.a.indexable(), self.b.indexable())
15501551
}
15511552

15521553
#[inline]
1553-
fn idx(&mut self, index: usize) -> Option<(T, U)> {
1554+
fn idx(&mut self, index: usize) -> Option<(A::Item, B::Item)> {
15541555
match self.a.idx(index) {
15551556
None => None,
15561557
Some(x) => match self.b.idx(index) {
@@ -2058,8 +2059,9 @@ pub struct Scan<I, St, F> {
20582059
}
20592060

20602061
#[stable(feature = "rust1", since = "1.0.0")]
2061-
impl<A, B, I: Iterator<Item=A>, St, F> Iterator for Scan<I, St, F> where
2062-
F: FnMut(&mut St, A) -> Option<B>,
2062+
impl<B, I, St, F> Iterator for Scan<I, St, F> where
2063+
I: Iterator,
2064+
F: FnMut(&mut St, I::Item) -> Option<B>,
20632065
{
20642066
type Item = B;
20652067

src/libcore/lib.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@
3535
//! often generated by LLVM. Additionally, this library can make explicit
3636
//! calls to these functions. Their signatures are the same as found in C.
3737
//! These functions are often provided by the system libc, but can also be
38-
//! provided by `librlibc` which is distributed with the standard rust
39-
//! distribution.
38+
//! provided by the [rlibc crate](https://crates.io/crates/rlibc).
4039
//!
4140
//! * `rust_begin_unwind` - This function takes three arguments, a
4241
//! `fmt::Arguments`, a `&str`, and a `usize`. These three arguments dictate
@@ -47,6 +46,8 @@
4746
// Since libcore defines many fundamental lang items, all tests live in a
4847
// separate crate, libcoretest, to avoid bizarre issues.
4948

49+
// Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364)
50+
#![cfg_attr(stage0, feature(custom_attribute))]
5051
#![crate_name = "core"]
5152
#![unstable(feature = "core")]
5253
#![staged_api]

0 commit comments

Comments
 (0)