Skip to content

Commit 1226a6d

Browse files
committed
---
yaml --- r: 193529 b: refs/heads/beta c: ae16afb h: refs/heads/master i: 193527: 6aeca92 v: v3
1 parent 82189cc commit 1226a6d

File tree

122 files changed

+1402
-351
lines changed

Some content is hidden

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

122 files changed

+1402
-351
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: a08f12954c0cfdc0864aea9b1b958ff0b4ee222d
34+
refs/heads/beta: ae16afb9e3ea783e50d810cfac8035ad03e628a4
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: de8a23bbc3a7b9cbd7574b5b91a34af59bf030e6

branches/beta/mk/main.mk

Lines changed: 3 additions & 3 deletions
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)

branches/beta/mk/tests.mk

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

branches/beta/src/compiletest/compiletest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
#![feature(path)]
2525
#![feature(os)]
2626
#![feature(io)]
27-
#![feature(fs)]
2827
#![feature(net)]
28+
#![feature(path_ext)]
2929

3030
#![deny(warnings)]
3131

branches/beta/src/doc/guide-tasks.md

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

branches/beta/src/doc/reference.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2555,6 +2555,14 @@ The currently implemented features of the reference compiler are:
25552555
types, e.g. as the return type of a public function.
25562556
This capability may be removed in the future.
25572557

2558+
* `allow_internal_unstable` - Allows `macro_rules!` macros to be tagged with the
2559+
`#[allow_internal_unstable]` attribute, designed
2560+
to allow `std` macros to call
2561+
`#[unstable]`/feature-gated functionality
2562+
internally without imposing on callers
2563+
(i.e. making them behave like function calls in
2564+
terms of encapsulation).
2565+
25582566
If a feature is promoted to a language feature, then all existing programs will
25592567
start to receive compilation warnings about #[feature] directives which enabled
25602568
the new feature (because the directive is no longer necessary). However, if a

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

Lines changed: 6 additions & 0 deletions
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

branches/beta/src/liballoc/lib.rs

Lines changed: 2 additions & 0 deletions
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)]

branches/beta/src/libarena/lib.rs

Lines changed: 2 additions & 0 deletions
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]

branches/beta/src/libcollections/lib.rs

Lines changed: 2 additions & 1 deletion
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]

branches/beta/src/libcollections/str.rs

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

branches/beta/src/libcore/iter.rs

Lines changed: 48 additions & 46 deletions
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

branches/beta/src/libcore/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
// Since libcore defines many fundamental lang items, all tests live in a
4848
// separate crate, libcoretest, to avoid bizarre issues.
4949

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

branches/beta/src/libcore/macros.rs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,12 @@ macro_rules! assert_eq {
100100
/// This will invoke the `panic!` macro if the provided expression cannot be
101101
/// evaluated to `true` at runtime.
102102
///
103-
/// Unlike `assert!`, `debug_assert!` statements can be disabled by passing
104-
/// `--cfg ndebug` to the compiler. This makes `debug_assert!` useful for
105-
/// checks that are too expensive to be present in a release build but may be
106-
/// helpful during development.
103+
/// Unlike `assert!`, `debug_assert!` statements are only enabled in non
104+
/// optimized builds by default. An optimized build will omit all
105+
/// `debug_assert!` statements unless `-C debug-assertions` is passed to the
106+
/// compiler. This makes `debug_assert!` useful for checks that are too
107+
/// expensive to be present in a release build but may be helpful during
108+
/// development.
107109
///
108110
/// # Example
109111
///
@@ -125,18 +127,20 @@ macro_rules! assert_eq {
125127
#[macro_export]
126128
#[stable(feature = "rust1", since = "1.0.0")]
127129
macro_rules! debug_assert {
128-
($($arg:tt)*) => (if cfg!(not(ndebug)) { assert!($($arg)*); })
130+
($($arg:tt)*) => (if cfg!(debug_assertions) { assert!($($arg)*); })
129131
}
130132

131133
/// Asserts that two expressions are equal to each other, testing equality in
132134
/// both directions.
133135
///
134136
/// On panic, this macro will print the values of the expressions.
135137
///
136-
/// Unlike `assert_eq!`, `debug_assert_eq!` statements can be disabled by
137-
/// passing `--cfg ndebug` to the compiler. This makes `debug_assert_eq!`
138-
/// useful for checks that are too expensive to be present in a release build
139-
/// but may be helpful during development.
138+
/// Unlike `assert_eq!`, `debug_assert_eq!` statements are only enabled in non
139+
/// optimized builds by default. An optimized build will omit all
140+
/// `debug_assert_eq!` statements unless `-C debug-assertions` is passed to the
141+
/// compiler. This makes `debug_assert_eq!` useful for checks that are too
142+
/// expensive to be present in a release build but may be helpful during
143+
/// development.
140144
///
141145
/// # Example
142146
///
@@ -147,7 +151,7 @@ macro_rules! debug_assert {
147151
/// ```
148152
#[macro_export]
149153
macro_rules! debug_assert_eq {
150-
($($arg:tt)*) => (if cfg!(not(ndebug)) { assert_eq!($($arg)*); })
154+
($($arg:tt)*) => (if cfg!(debug_assertions) { assert_eq!($($arg)*); })
151155
}
152156

153157
/// Short circuiting evaluation on Err

branches/beta/src/libcore/num/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,6 +1238,7 @@ pub fn from_f64<A: FromPrimitive>(n: f64) -> Option<A> {
12381238

12391239
macro_rules! impl_from_primitive {
12401240
($T:ty, $to_ty:ident) => (
1241+
#[allow(deprecated)]
12411242
impl FromPrimitive for $T {
12421243
#[inline] fn from_int(n: int) -> Option<$T> { n.$to_ty() }
12431244
#[inline] fn from_i8(n: i8) -> Option<$T> { n.$to_ty() }
@@ -1299,6 +1300,7 @@ macro_rules! impl_num_cast {
12991300
($T:ty, $conv:ident) => (
13001301
impl NumCast for $T {
13011302
#[inline]
1303+
#[allow(deprecated)]
13021304
fn from<N: ToPrimitive>(n: N) -> Option<$T> {
13031305
// `$conv` could be generated using `concat_idents!`, but that
13041306
// macro seems to be broken at the moment

0 commit comments

Comments
 (0)