Skip to content

Commit b945c1f

Browse files
committed
---
yaml --- r: 195967 b: refs/heads/beta c: e48c7c6 h: refs/heads/master i: 195965: 70ffeee 195963: b774ed0 195959: a48f1f3 195951: e412718 195935: 0460452 195903: 646e8b1 195839: 079cddd v: v3
1 parent 284b4a2 commit b945c1f

File tree

219 files changed

+4418
-1508
lines changed

Some content is hidden

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

219 files changed

+4418
-1508
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2929
refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3030
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3131
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
32-
refs/heads/beta: 82889f709ea4b28fed03f9fa96e6ab6562230806
32+
refs/heads/beta: e48c7c61eb241fadc0835c7bdd041e042c43f622
3333
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3434
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3535
refs/heads/tmp: 9de34a84bb300bab1bf0227f577331620cd60511

branches/beta/mk/tests.mk

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ $(foreach file,$(wildcard $(S)src/doc/trpl/*.md), \
166166
######################################################################
167167

168168
# The main testing target. Tests lots of stuff.
169-
check: check-sanitycheck cleantmptestlogs cleantestlibs all check-stage2 tidy
169+
check: cleantmptestlogs cleantestlibs all check-stage2 tidy
170170
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
171171

172172
# As above but don't bother running tidy.
@@ -193,11 +193,6 @@ check-docs: cleantestlibs cleantmptestlogs check-stage2-docs
193193
# Not run as part of the normal test suite, but tested by bors on checkin.
194194
check-secondary: check-build-compiletest check-build-lexer-verifier check-lexer check-pretty
195195

196-
.PHONY: check-sanitycheck
197-
198-
check-sanitycheck:
199-
$(Q)$(CFG_PYTHON) $(S)src/etc/check-sanitycheck.py
200-
201196
# check + check-secondary.
202197
#
203198
# Issue #17883: build check-secondary first so hidden dependencies in

branches/beta/src/compiletest/compiletest.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#![feature(std_misc)]
1919
#![feature(test)]
2020
#![feature(path_ext)]
21+
#![feature(convert)]
2122
#![feature(str_char)]
2223

2324
#![deny(warnings)]

branches/beta/src/doc/reference.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -977,13 +977,17 @@ An example of `use` declarations:
977977

978978
```
979979
# #![feature(core)]
980+
use std::iter::range_step;
980981
use std::option::Option::{Some, None};
981982
use std::collections::hash_map::{self, HashMap};
982983
983984
fn foo<T>(_: T){}
984985
fn bar(map1: HashMap<String, usize>, map2: hash_map::HashMap<String, usize>){}
985986
986987
fn main() {
988+
// Equivalent to 'std::iter::range_step(0, 10, 2);'
989+
range_step(0, 10, 2);
990+
987991
// Equivalent to 'foo(vec![std::option::Option::Some(1.0f64),
988992
// std::option::Option::None]);'
989993
foo(vec![Some(1.0f64), None]);

branches/beta/src/doc/trpl/concurrency.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -280,15 +280,13 @@ it returns an `Result<T, E>`, and because this is just an example, we `unwrap()`
280280
it to get a reference to the data. Real code would have more robust error handling
281281
here. We're then free to mutate it, since we have the lock.
282282

283-
Lastly, while the threads are running, we wait on a short timer. But
284-
this is not ideal: we may have picked a reasonable amount of time to
285-
wait but it's more likely we'll either be waiting longer than
286-
necessary or not long enough, depending on just how much time the
287-
threads actually take to finish computing when the program runs.
288-
289-
A more precise alternative to the timer would be to use one of the
290-
mechanisms provided by the Rust standard library for synchronizing
291-
threads with each other. Let's talk about one of them: channels.
283+
This timer bit is a bit awkward, however. We have picked a reasonable amount of
284+
time to wait, but it's entirely possible that we've picked too high, and that
285+
we could be taking less time. It's also possible that we've picked too low,
286+
and that we aren't actually finishing this computation.
287+
288+
Rust's standard library provides a few more mechanisms for two threads to
289+
synchronize with each other. Let's talk about one: channels.
292290

293291
## Channels
294292

branches/beta/src/doc/trpl/iterators.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -243,12 +243,11 @@ for num in nums.iter() {
243243
```
244244

245245
These two basic iterators should serve you well. There are some more
246-
advanced iterators, including ones that are infinite. Like using range syntax
247-
and `step_by`:
246+
advanced iterators, including ones that are infinite. Like `count`:
248247

249248
```rust
250-
# #![feature(step_by)]
251-
(1..).step_by(5);
249+
# #![feature(core)]
250+
std::iter::count(1, 5);
252251
```
253252

254253
This iterator counts up from one, adding five each time. It will give
@@ -293,11 +292,11 @@ just use `for` instead.
293292
There are tons of interesting iterator adapters. `take(n)` will return an
294293
iterator over the next `n` elements of the original iterator, note that this
295294
has no side effect on the original iterator. Let's try it out with our infinite
296-
iterator from before:
295+
iterator from before, `count()`:
297296

298297
```rust
299-
# #![feature(step_by)]
300-
for i in (1..).step_by(5).take(5) {
298+
# #![feature(core)]
299+
for i in std::iter::count(1, 5).take(5) {
301300
println!("{}", i);
302301
}
303302
```

branches/beta/src/doc/trpl/ownership.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ forbidden in item signatures to allow reasoning about the types just based in
477477
the item signature alone. However, for ergonomic reasons a very restricted
478478
secondary inference algorithm called “lifetime elision” applies in function
479479
signatures. It infers only based on the signature components themselves and not
480-
based on the body of the function, only infers lifetime paramters, and does
480+
based on the body of the function, only infers lifetime parameters, and does
481481
this with only three easily memorizable and unambiguous rules. This makes
482482
lifetime elision a shorthand for writing an item signature, while not hiding
483483
away the actual types involved as full local inference would if applied to it.

branches/beta/src/etc/check-sanitycheck.py

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

branches/beta/src/liballoc/arc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ use heap::deallocate;
110110
/// let child_numbers = shared_numbers.clone();
111111
///
112112
/// thread::spawn(move || {
113-
/// let local_numbers = &child_numbers[..];
113+
/// let local_numbers = child_numbers.as_slice();
114114
///
115115
/// // Work with the local numbers
116116
/// });

branches/beta/src/liballoc/boxed.rs

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ use core::prelude::*;
5151
use core::any::Any;
5252
use core::cmp::Ordering;
5353
use core::default::Default;
54-
use core::error::Error;
54+
use core::error::{Error, FromError};
5555
use core::fmt;
5656
use core::hash::{self, Hash};
5757
use core::mem;
@@ -233,10 +233,24 @@ impl<T: ?Sized + Hash> Hash for Box<T> {
233233
}
234234
}
235235

236-
impl Box<Any> {
237-
#[inline]
236+
/// Extension methods for an owning `Any` trait object.
237+
#[unstable(feature = "alloc",
238+
reason = "this trait will likely disappear once compiler bugs blocking \
239+
a direct impl on `Box<Any>` have been fixed ")]
240+
// FIXME(#18737): this should be a direct impl on `Box<Any>`. If you're
241+
// removing this please make sure that you can downcase on
242+
// `Box<Any + Send>` as well as `Box<Any>`
243+
pub trait BoxAny {
244+
/// Returns the boxed value if it is of type `T`, or
245+
/// `Err(Self)` if it isn't.
238246
#[stable(feature = "rust1", since = "1.0.0")]
239-
pub fn downcast<T: Any>(self) -> Result<Box<T>, Box<Any>> {
247+
fn downcast<T: Any>(self) -> Result<Box<T>, Box<Any>>;
248+
}
249+
250+
#[stable(feature = "rust1", since = "1.0.0")]
251+
impl BoxAny for Box<Any> {
252+
#[inline]
253+
fn downcast<T: Any>(self) -> Result<Box<T>, Box<Any>> {
240254
if self.is::<T>() {
241255
unsafe {
242256
// Get the raw representation of the trait object
@@ -253,10 +267,10 @@ impl Box<Any> {
253267
}
254268
}
255269

256-
impl Box<Any+Send> {
270+
#[stable(feature = "rust1", since = "1.0.0")]
271+
impl BoxAny for Box<Any+Send> {
257272
#[inline]
258-
#[stable(feature = "rust1", since = "1.0.0")]
259-
pub fn downcast<T: Any>(self) -> Result<Box<T>, Box<Any>> {
273+
fn downcast<T: Any>(self) -> Result<Box<T>, Box<Any>> {
260274
<Box<Any>>::downcast(self)
261275
}
262276
}
@@ -308,8 +322,8 @@ impl<I: DoubleEndedIterator + ?Sized> DoubleEndedIterator for Box<I> {
308322
impl<I: ExactSizeIterator + ?Sized> ExactSizeIterator for Box<I> {}
309323

310324
#[stable(feature = "rust1", since = "1.0.0")]
311-
impl<'a, E: Error + 'a> From<E> for Box<Error + 'a> {
312-
fn from(err: E) -> Box<Error + 'a> {
325+
impl<'a, E: Error + 'a> FromError<E> for Box<Error + 'a> {
326+
fn from_error(err: E) -> Box<Error + 'a> {
313327
Box::new(err)
314328
}
315329
}

branches/beta/src/liballoc/boxed_test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use core::clone::Clone;
1717

1818
use std::boxed;
1919
use std::boxed::Box;
20+
use std::boxed::BoxAny;
2021

2122
#[test]
2223
fn test_owned_clone() {

branches/beta/src/libcollections/bit.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
//! [sieve]: http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
3939
//!
4040
//! ```
41-
//! # #![feature(collections, core, step_by)]
41+
//! # #![feature(collections, core)]
4242
//! use std::collections::{BitSet, BitVec};
4343
//! use std::num::Float;
4444
//! use std::iter;
@@ -60,7 +60,7 @@
6060
//! if bv[i] {
6161
//! // Mark all multiples of i as non-prime (any multiples below i * i
6262
//! // will have been marked as non-prime previously)
63-
//! for j in (i * i..max_prime).step_by(i) { bv.set(j, false) }
63+
//! for j in iter::range_step(i * i, max_prime, i) { bv.set(j, false) }
6464
//! }
6565
//! }
6666
//! BitSet::from_bit_vec(bv)
@@ -1264,6 +1264,14 @@ impl BitSet {
12641264
BitSet { bit_vec: bit_vec }
12651265
}
12661266

1267+
/// Deprecated: use `from_bit_vec`.
1268+
#[inline]
1269+
#[deprecated(since = "1.0.0", reason = "renamed to from_bit_vec")]
1270+
#[unstable(feature = "collections")]
1271+
pub fn from_bitv(bit_vec: BitVec) -> BitSet {
1272+
BitSet { bit_vec: bit_vec }
1273+
}
1274+
12671275
/// Returns the capacity in bits for this bit vector. Inserting any
12681276
/// element less than this amount will not trigger a resizing.
12691277
///

branches/beta/src/libcollections/borrow.rs

Lines changed: 20 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,6 @@ use self::Cow::*;
4040
#[stable(feature = "rust1", since = "1.0.0")]
4141
pub trait Borrow<Borrowed: ?Sized> {
4242
/// Immutably borrow from an owned value.
43-
///
44-
/// # Examples
45-
///
46-
/// ```
47-
/// use std::borrow::Borrow;
48-
///
49-
/// fn check<T: Borrow<str>>(s: T) {
50-
/// assert_eq!("Hello", s.borrow());
51-
/// }
52-
///
53-
/// let s = "Hello".to_string();
54-
///
55-
/// check(s);
56-
///
57-
/// let s = "Hello";
58-
///
59-
/// check(s);
60-
/// ```
6143
#[stable(feature = "rust1", since = "1.0.0")]
6244
fn borrow(&self) -> &Borrowed;
6345
}
@@ -68,20 +50,6 @@ pub trait Borrow<Borrowed: ?Sized> {
6850
#[stable(feature = "rust1", since = "1.0.0")]
6951
pub trait BorrowMut<Borrowed: ?Sized> : Borrow<Borrowed> {
7052
/// Mutably borrow from an owned value.
71-
///
72-
/// # Examples
73-
///
74-
/// ```
75-
/// use std::borrow::BorrowMut;
76-
///
77-
/// fn check<T: BorrowMut<[i32]>>(mut v: T) {
78-
/// assert_eq!(&mut [1, 2, 3], v.borrow_mut());
79-
/// }
80-
///
81-
/// let v = vec![1, 2, 3];
82-
///
83-
/// check(v);
84-
/// ```
8553
#[stable(feature = "rust1", since = "1.0.0")]
8654
fn borrow_mut(&mut self) -> &mut Borrowed;
8755
}
@@ -203,18 +171,6 @@ impl<'a, B: ?Sized> Cow<'a, B> where B: ToOwned {
203171
/// Acquire a mutable reference to the owned form of the data.
204172
///
205173
/// Copies the data if it is not already owned.
206-
///
207-
/// # Examples
208-
///
209-
/// ```
210-
/// use std::borrow::Cow;
211-
///
212-
/// let mut cow: Cow<[_]> = Cow::Owned(vec![1, 2, 3]);
213-
///
214-
/// let hello = cow.to_mut();
215-
///
216-
/// assert_eq!(hello, &[1, 2, 3]);
217-
/// ```
218174
#[stable(feature = "rust1", since = "1.0.0")]
219175
pub fn to_mut(&mut self) -> &mut <B as ToOwned>::Owned {
220176
match *self {
@@ -229,25 +185,33 @@ impl<'a, B: ?Sized> Cow<'a, B> where B: ToOwned {
229185
/// Extract the owned data.
230186
///
231187
/// Copies the data if it is not already owned.
232-
///
233-
/// # Examples
234-
///
235-
/// ```
236-
/// use std::borrow::Cow;
237-
///
238-
/// let cow: Cow<[_]> = Cow::Owned(vec![1, 2, 3]);
239-
///
240-
/// let hello = cow.into_owned();
241-
///
242-
/// assert_eq!(vec![1, 2, 3], hello);
243-
/// ```
244188
#[stable(feature = "rust1", since = "1.0.0")]
245189
pub fn into_owned(self) -> <B as ToOwned>::Owned {
246190
match self {
247191
Borrowed(borrowed) => borrowed.to_owned(),
248192
Owned(owned) => owned
249193
}
250194
}
195+
196+
/// Returns true if this `Cow` wraps a borrowed value
197+
#[deprecated(since = "1.0.0", reason = "match on the enum instead")]
198+
#[unstable(feature = "std_misc")]
199+
pub fn is_borrowed(&self) -> bool {
200+
match *self {
201+
Borrowed(_) => true,
202+
_ => false,
203+
}
204+
}
205+
206+
/// Returns true if this `Cow` wraps an owned value
207+
#[deprecated(since = "1.0.0", reason = "match on the enum instead")]
208+
#[unstable(feature = "std_misc")]
209+
pub fn is_owned(&self) -> bool {
210+
match *self {
211+
Owned(_) => true,
212+
_ => false,
213+
}
214+
}
251215
}
252216

253217
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)