Skip to content

Commit 58ddf8a

Browse files
committed
---
yaml --- r: 195503 b: refs/heads/master c: 6659865 h: refs/heads/master i: 195501: 11edb27 195499: 76f1f33 195495: 6a9fe36 195487: 9fbe0d7 v: v3
1 parent 14d6933 commit 58ddf8a

File tree

243 files changed

+1686
-4576
lines changed

Some content is hidden

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

243 files changed

+1686
-4576
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 8da08317a6e5bce60b833c279564728c68938973
2+
refs/heads/master: 66598656a5bb684479473235a64ea2b4f2fda0d2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: b3317d68910900f135f9f38e43a7a699bc736b4a
55
refs/heads/try: 961e0358e1a5c0faaef606e31e9965742c1643bf

trunk/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

trunk/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)]

trunk/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]);

trunk/src/doc/trpl/concurrency.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -280,13 +280,15 @@ 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-
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.
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.
290292

291293
## Channels
292294

trunk/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
```

trunk/src/doc/trpl/macros.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ number of elements.
3737

3838
```rust
3939
let x: Vec<u32> = vec![1, 2, 3];
40-
# assert_eq!(&[1,2,3], &x);
40+
# assert_eq!(x, [1, 2, 3]);
4141
```
4242

4343
This can't be an ordinary function, because it takes any number of arguments.
@@ -51,7 +51,7 @@ let x: Vec<u32> = {
5151
temp_vec.push(3);
5252
temp_vec
5353
};
54-
# assert_eq!(&[1,2,3], &x);
54+
# assert_eq!(x, [1, 2, 3]);
5555
```
5656

5757
We can implement this shorthand, using a macro: [^actual]
@@ -73,7 +73,7 @@ macro_rules! vec {
7373
};
7474
}
7575
# fn main() {
76-
# assert_eq!([1,2,3], vec![1,2,3]);
76+
# assert_eq!(vec![1,2,3], [1, 2, 3]);
7777
# }
7878
```
7979

trunk/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.

trunk/src/etc/check-sanitycheck.py

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)

trunk/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
/// });

trunk/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
}

trunk/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() {

trunk/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
///

0 commit comments

Comments
 (0)