Skip to content

Commit 284b4a2

Browse files
committed
---
yaml --- r: 195966 b: refs/heads/beta c: 82889f7 h: refs/heads/master v: v3
1 parent 70ffeee commit 284b4a2

File tree

217 files changed

+1498
-4410
lines changed

Some content is hidden

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

217 files changed

+1498
-4410
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: 9ba7974b357c7f2f69d74c9f8a01e282d7f4da6f
32+
refs/heads/beta: 82889f709ea4b28fed03f9fa96e6ab6562230806
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: 6 additions & 1 deletion
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: cleantmptestlogs cleantestlibs all check-stage2 tidy
169+
check: check-sanitycheck 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,6 +193,11 @@ 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+
196201
# check + check-secondary.
197202
#
198203
# Issue #17883: build check-secondary first so hidden dependencies in

branches/beta/src/compiletest/compiletest.rs

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

2423
#![deny(warnings)]

branches/beta/src/doc/reference.md

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

978978
```
979979
# #![feature(core)]
980-
use std::iter::range_step;
981980
use std::option::Option::{Some, None};
982981
use std::collections::hash_map::{self, HashMap};
983982
984983
fn foo<T>(_: T){}
985984
fn bar(map1: HashMap<String, usize>, map2: hash_map::HashMap<String, usize>){}
986985
987986
fn main() {
988-
// Equivalent to 'std::iter::range_step(0, 10, 2);'
989-
range_step(0, 10, 2);
990-
991987
// Equivalent to 'foo(vec![std::option::Option::Some(1.0f64),
992988
// std::option::Option::None]);'
993989
foo(vec![Some(1.0f64), None]);

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,12 @@ 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 `count`:
246+
advanced iterators, including ones that are infinite. Like using range syntax
247+
and `step_by`:
247248

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

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

297298
```rust
298-
# #![feature(core)]
299-
for i in std::iter::count(1, 5).take(5) {
299+
# #![feature(step_by)]
300+
for i in (1..).step_by(5).take(5) {
300301
println!("{}", i);
301302
}
302303
```
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/usr/bin/env python
2+
#
3+
# Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
4+
# file at the top-level directory of this distribution and at
5+
# http://rust-lang.org/COPYRIGHT.
6+
#
7+
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
8+
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
9+
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
10+
# option. This file may not be copied, modified, or distributed
11+
# except according to those terms.
12+
13+
import os
14+
import sys
15+
import functools
16+
import resource
17+
18+
STATUS = 0
19+
20+
21+
def error_unless_permitted(env_var, message):
22+
global STATUS
23+
if not os.getenv(env_var):
24+
sys.stderr.write(message)
25+
STATUS = 1
26+
27+
28+
def only_on(platforms):
29+
def decorator(func):
30+
@functools.wraps(func)
31+
def inner():
32+
if any(map(lambda x: sys.platform.startswith(x), platforms)):
33+
func()
34+
return inner
35+
return decorator
36+
37+
38+
@only_on(('linux', 'darwin', 'freebsd', 'openbsd'))
39+
def check_rlimit_core():
40+
soft, hard = resource.getrlimit(resource.RLIMIT_CORE)
41+
if soft > 0:
42+
error_unless_permitted('ALLOW_NONZERO_RLIMIT_CORE', """\
43+
RLIMIT_CORE is set to a nonzero value (%d). During debuginfo, the test suite
44+
will segfault many rustc's, creating many potentially large core files.
45+
set ALLOW_NONZERO_RLIMIT_CORE to ignore this warning
46+
""" % (soft))
47+
48+
49+
def main():
50+
check_rlimit_core()
51+
52+
if __name__ == '__main__':
53+
main()
54+
sys.exit(STATUS)

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.as_slice();
113+
/// let local_numbers = &child_numbers[..];
114114
///
115115
/// // Work with the local numbers
116116
/// });

branches/beta/src/liballoc/boxed.rs

Lines changed: 9 additions & 23 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, FromError};
54+
use core::error::Error;
5555
use core::fmt;
5656
use core::hash::{self, Hash};
5757
use core::mem;
@@ -233,24 +233,10 @@ impl<T: ?Sized + Hash> Hash for Box<T> {
233233
}
234234
}
235235

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.
246-
#[stable(feature = "rust1", since = "1.0.0")]
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> {
236+
impl Box<Any> {
252237
#[inline]
253-
fn downcast<T: Any>(self) -> Result<Box<T>, Box<Any>> {
238+
#[stable(feature = "rust1", since = "1.0.0")]
239+
pub fn downcast<T: Any>(self) -> Result<Box<T>, Box<Any>> {
254240
if self.is::<T>() {
255241
unsafe {
256242
// Get the raw representation of the trait object
@@ -267,10 +253,10 @@ impl BoxAny for Box<Any> {
267253
}
268254
}
269255

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

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

branches/beta/src/liballoc/boxed_test.rs

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

1818
use std::boxed;
1919
use std::boxed::Box;
20-
use std::boxed::BoxAny;
2120

2221
#[test]
2322
fn test_owned_clone() {

branches/beta/src/libcollections/bit.rs

Lines changed: 2 additions & 10 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)]
41+
//! # #![feature(collections, core, step_by)]
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 iter::range_step(i * i, max_prime, i) { bv.set(j, false) }
63+
//! for j in (i * i..max_prime).step_by(i) { bv.set(j, false) }
6464
//! }
6565
//! }
6666
//! BitSet::from_bit_vec(bv)
@@ -1264,14 +1264,6 @@ 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-
12751267
/// Returns the capacity in bits for this bit vector. Inserting any
12761268
/// element less than this amount will not trigger a resizing.
12771269
///

branches/beta/src/libcollections/borrow.rs

Lines changed: 56 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,24 @@ 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+
/// ```
4361
#[stable(feature = "rust1", since = "1.0.0")]
4462
fn borrow(&self) -> &Borrowed;
4563
}
@@ -50,6 +68,20 @@ pub trait Borrow<Borrowed: ?Sized> {
5068
#[stable(feature = "rust1", since = "1.0.0")]
5169
pub trait BorrowMut<Borrowed: ?Sized> : Borrow<Borrowed> {
5270
/// 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+
/// ```
5385
#[stable(feature = "rust1", since = "1.0.0")]
5486
fn borrow_mut(&mut self) -> &mut Borrowed;
5587
}
@@ -171,6 +203,18 @@ impl<'a, B: ?Sized> Cow<'a, B> where B: ToOwned {
171203
/// Acquire a mutable reference to the owned form of the data.
172204
///
173205
/// 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+
/// ```
174218
#[stable(feature = "rust1", since = "1.0.0")]
175219
pub fn to_mut(&mut self) -> &mut <B as ToOwned>::Owned {
176220
match *self {
@@ -185,33 +229,25 @@ impl<'a, B: ?Sized> Cow<'a, B> where B: ToOwned {
185229
/// Extract the owned data.
186230
///
187231
/// 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+
/// ```
188244
#[stable(feature = "rust1", since = "1.0.0")]
189245
pub fn into_owned(self) -> <B as ToOwned>::Owned {
190246
match self {
191247
Borrowed(borrowed) => borrowed.to_owned(),
192248
Owned(owned) => owned
193249
}
194250
}
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-
}
215251
}
216252

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

0 commit comments

Comments
 (0)