Skip to content

Commit 8ccb53d

Browse files
committed
---
yaml --- r: 232733 b: refs/heads/try c: fd302a9 h: refs/heads/master i: 232731: 862d572 v: v3
1 parent 1ca678e commit 8ccb53d

File tree

196 files changed

+4587
-2814
lines changed

Some content is hidden

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

196 files changed

+4587
-2814
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: edeb4f1c86cbf6af8ef9874d4b3af50f721ea1b8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: 6174b8d726ed5764694e5404329d8b5e66517ed5
4+
refs/heads/try: fd302a95e1197e5f8401ecaa15f2cb0f81c830c3
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/configure

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ valopt python "" "set path to python"
602602
valopt jemalloc-root "" "set directory where libjemalloc_pic.a is located"
603603
valopt build "${DEFAULT_BUILD}" "GNUs ./configure syntax LLVM build triple"
604604
valopt android-cross-path "/opt/ndk_standalone" "Android NDK standalone path (deprecated)"
605+
valopt i686-linux-android-ndk "" "i686-linux-android NDK standalone path"
605606
valopt arm-linux-androideabi-ndk "" "arm-linux-androideabi NDK standalone path"
606607
valopt aarch64-linux-android-ndk "" "aarch64-linux-android NDK standalone path"
607608
valopt release-channel "dev" "the name of the release channel to build"
@@ -1693,6 +1694,7 @@ putvar CFG_LIBDIR_RELATIVE
16931694
putvar CFG_DISABLE_MANAGE_SUBMODULES
16941695
putvar CFG_AARCH64_LINUX_ANDROID_NDK
16951696
putvar CFG_ARM_LINUX_ANDROIDEABI_NDK
1697+
putvar CFG_I686_LINUX_ANDROID_NDK
16961698
putvar CFG_MANDIR
16971699

16981700
# Avoid spurious warnings from clang by feeding it original source on
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# i686-linux-android configuration
2+
CC_i686-linux-android=$(CFG_I686_LINUX_ANDROID_NDK)/bin/i686-linux-android-gcc
3+
CXX_i686-linux-android=$(CFG_I686_LINUX_ANDROID_NDK)/bin/i686-linux-android-g++
4+
CPP_i686-linux-android=$(CFG_I686_LINUX_ANDROID_NDK)/bin/i686-linux-android-gcc -E
5+
AR_i686-linux-android=$(CFG_I686_LINUX_ANDROID_NDK)/bin/i686-linux-android-ar
6+
CFG_LIB_NAME_i686-linux-android=lib$(1).so
7+
CFG_STATIC_LIB_NAME_i686-linux-android=lib$(1).a
8+
CFG_LIB_GLOB_i686-linux-android=lib$(1)-*.so
9+
CFG_LIB_DSYM_GLOB_i686-linux-android=lib$(1)-*.dylib.dSYM
10+
CFG_JEMALLOC_CFLAGS_i686-linux-android := -D__i686__ -DANDROID -D__ANDROID__ $(CFLAGS)
11+
CFG_GCCISH_CFLAGS_i686-linux-android := -Wall -g -fPIC -D__i686__ -DANDROID -D__ANDROID__ $(CFLAGS)
12+
CFG_GCCISH_CXXFLAGS_i686-linux-android := -fno-rtti $(CXXFLAGS)
13+
CFG_GCCISH_LINK_FLAGS_i686-linux-android := -shared -fPIC -ldl -g -lm -lsupc++
14+
CFG_GCCISH_DEF_FLAG_i686-linux-android := -Wl,--export-dynamic,--dynamic-list=
15+
CFG_LLC_FLAGS_i686-linux-android :=
16+
CFG_INSTALL_NAME_i686-linux-android =
17+
CFG_EXE_SUFFIX_i686-linux-android :=
18+
CFG_WINDOWSY_i686-linux-android :=
19+
CFG_UNIXY_i686-linux-android := 1
20+
CFG_LDPATH_i686-linux-android :=
21+
CFG_RUN_i686-linux-android=
22+
CFG_RUN_TARG_i686-linux-android=
23+
RUSTC_FLAGS_i686-linux-android :=
24+
RUSTC_CROSS_FLAGS_i686-linux-android :=
25+
CFG_GNU_TRIPLE_i686-linux-android := i686-linux-android

branches/try/src/compiletest/compiletest.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#![feature(str_char)]
2020
#![feature(test)]
2121
#![feature(vec_push_all)]
22+
#![feature(path_components_peek)]
2223

2324
#![deny(warnings)]
2425

branches/try/src/compiletest/runtest.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use std::fs::{self, File};
2525
use std::io::BufReader;
2626
use std::io::prelude::*;
2727
use std::net::TcpStream;
28-
use std::path::{Path, PathBuf};
28+
use std::path::{Path, PathBuf, Component};
2929
use std::process::{Command, Output, ExitStatus};
3030

3131
pub fn run(config: Config, testfile: &Path) {
@@ -952,6 +952,9 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError>,
952952
// filename:line1:col1: line2:col2: *warning:* msg
953953
// where line1:col1: is the starting point, line2:col2:
954954
// is the ending point, and * represents ANSI color codes.
955+
//
956+
// This pattern is ambiguous on windows, because filename may contain
957+
// a colon, so any path prefix must be detected and removed first.
955958
for line in proc_res.stderr.lines() {
956959
let mut was_expected = false;
957960
let mut prev = 0;
@@ -1006,7 +1009,16 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError>,
10061009
}
10071010
}
10081011

1009-
fn is_compiler_error_or_warning(line: &str) -> bool {
1012+
fn is_compiler_error_or_warning(mut line: &str) -> bool {
1013+
// Remove initial prefix which may contain a colon
1014+
let mut components = Path::new(line).components();
1015+
if let Some(Component::Prefix(_)) = components.peek() {
1016+
components.next();
1017+
}
1018+
1019+
// Safe as path was originally constructed from a &str ^
1020+
line = components.as_path().to_str().unwrap();
1021+
10101022
let mut i = 0;
10111023
return
10121024
scan_until_char(line, ':', &mut i) &&

branches/try/src/doc/nomicon/coercions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Coercion is allowed between the following types:
2222
for all pointer types (including smart pointers like Box and Rc). Unsize is
2323
only implemented automatically, and enables the following transformations:
2424

25-
* `[T, ..n]` => `[T]`
25+
* `[T; n]` => `[T]`
2626
* `T` => `Trait` where `T: Trait`
2727
* `Foo<..., T, ...>` => `Foo<..., U, ...>` where:
2828
* `T: Unsize<U>`

branches/try/src/doc/nomicon/safe-unsafe-meaning.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ unsafe impl UnsafeOrd for MyType {
125125
But it's probably not the implementation you want.
126126

127127
Rust has traditionally avoided making traits unsafe because it makes Unsafe
128-
pervasive, which is not desirable. Send and Sync are unsafe is because thread
128+
pervasive, which is not desirable. The reason Send and Sync are unsafe is because thread
129129
safety is a *fundamental property* that unsafe code cannot possibly hope to defend
130130
against in the same way it would defend against a bad Ord implementation. The
131131
only way to possibly defend against thread-unsafety would be to *not use

branches/try/src/doc/reference.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,7 @@ fn draw_twice<T: Shape>(surface: Surface, sh: T) {
14521452
}
14531453
```
14541454

1455-
Traits also define an [trait object](#trait-objects) with the same
1455+
Traits also define a [trait object](#trait-objects) with the same
14561456
name as the trait. Values of this type are created by coercing from a
14571457
pointer of some specific type to a pointer of trait type. For example,
14581458
`&T` could be coerced to `&Shape` if `T: Shape` holds (and similarly
@@ -1881,11 +1881,15 @@ type int8_t = i8;
18811881
- `no_start` - disable linking to the `native` crate, which specifies the
18821882
"start" language item.
18831883
- `no_std` - disable linking to the `std` crate.
1884-
- `plugin` load a list of named crates as compiler plugins, e.g.
1884+
- `plugin` - load a list of named crates as compiler plugins, e.g.
18851885
`#![plugin(foo, bar)]`. Optional arguments for each plugin,
18861886
i.e. `#![plugin(foo(... args ...))]`, are provided to the plugin's
18871887
registrar function. The `plugin` feature gate is required to use
18881888
this attribute.
1889+
- `recursion_limit` - Sets the maximum depth for potentially
1890+
infinitely-recursive compile-time operations like
1891+
auto-dereference or macro expansion. The default is
1892+
`#![recursion_limit="64"]`.
18891893

18901894
### Module-only attributes
18911895

@@ -2073,6 +2077,7 @@ The following configurations must be defined by the implementation:
20732077
* `target_pointer_width = "..."`. Target pointer width in bits. This is set
20742078
to `"32"` for targets with 32-bit pointers, and likewise set to `"64"` for
20752079
64-bit pointers.
2080+
* `test`. Enabled when compiling the test harness (using the `--test` flag).
20762081
* `unix`. See `target_family`.
20772082
* `windows`. See `target_family`.
20782083

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,12 +343,14 @@ threads as a simple isolation mechanism:
343343
```rust
344344
use std::thread;
345345

346-
let result = thread::spawn(move || {
346+
let handle = thread::spawn(move || {
347347
panic!("oops!");
348-
}).join();
348+
});
349+
350+
let result = handle.join();
349351

350352
assert!(result.is_err());
351353
```
352354

353-
Our `Thread` gives us a `Result` back, which allows us to check if the thread
355+
`Thread.join()` gives us a `Result` back, which allows us to check if the thread
354356
has panicked or not.

branches/try/src/doc/trpl/crates-and-modules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ $ ls target/debug
115115
build deps examples libphrases-a7448e02a0468eaa.rlib native
116116
```
117117

118-
`libphrase-hash.rlib` is the compiled crate. Before we see how to use this
118+
`libphrases-hash.rlib` is the compiled crate. Before we see how to use this
119119
crate from another crate, let’s break it up into multiple files.
120120

121121
# Multiple file crates

branches/try/src/doc/trpl/documentation.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ hello.rs:4 }
7373
```
7474

7575
This [unfortunate error](https://github.com/rust-lang/rust/issues/22547) is
76-
correct: documentation comments apply to the thing after them, and there's no
77-
thing after that last comment.
76+
correct: documentation comments apply to the thing after them, and there's
77+
nothing after that last comment.
7878

7979
[rc-new]: https://doc.rust-lang.org/nightly/std/rc/struct.Rc.html#method.new
8080

@@ -196,10 +196,10 @@ This will highlight according to whatever language you're showing off.
196196
If you're just showing plain text, choose `text`.
197197

198198
It's important to choose the correct annotation here, because `rustdoc` uses it
199-
in an interesting way: It can be used to actually test your examples, so that
200-
they don't get out of date. If you have some C code but `rustdoc` thinks it's
201-
Rust because you left off the annotation, `rustdoc` will complain when trying to
202-
generate the documentation.
199+
in an interesting way: It can be used to actually test your examples in a
200+
library crate, so that they don't get out of date. If you have some C code but
201+
`rustdoc` thinks it's Rust because you left off the annotation, `rustdoc` will
202+
complain when trying to generate the documentation.
203203

204204
## Documentation as tests
205205

@@ -377,8 +377,8 @@ $ rustdoc --test path/to/my/crate/root.rs
377377
$ cargo test
378378
```
379379

380-
That's right, `cargo test` tests embedded documentation too. However,
381-
`cargo test` will not test binary crates, only library ones. This is
380+
That's right, `cargo test` tests embedded documentation too. **However,
381+
`cargo test` will not test binary crates, only library ones.** This is
382382
due to the way `rustdoc` works: it links against the library to be tested,
383383
but with a binary, there’s nothing to link to.
384384

branches/try/src/doc/trpl/error-handling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ Because these kinds of situations are relatively rare, use panics sparingly.
208208

209209
In certain circumstances, even though a function may fail, we may want to treat
210210
it as a panic instead. For example, `io::stdin().read_line(&mut buffer)` returns
211-
a `Result<usize>`, when there is an error reading the line. This allows us to
212-
handle and possibly recover from error.
211+
a `Result<usize>`, which can indicate an error if one occurs when reading the line.
212+
This allows us to handle and possibly recover from errors.
213213

214214
If we don't want to handle this error, and would rather just abort the program,
215215
we can use the `unwrap()` method:

branches/try/src/doc/trpl/glossary.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ let z = (8, 2, 6);
3838

3939
In the example above `x` and `y` have arity 2. `z` has arity 3.
4040

41+
### DST (Dynamically Sized Type)
42+
43+
A type without a statically known size or alignment. ([more info][link])
44+
45+
[link]: ../nomicon/exotic-sizes.html#dynamically-sized-types-(dsts)
46+
4147
### Expression
4248

4349
In computer programming, an expression is a combination of values, constants,

branches/try/src/doc/trpl/testing.md

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,66 @@ fn it_works() {
219219
This is a very common use of `assert_eq!`: call some function with
220220
some known arguments and compare it to the expected output.
221221

222+
# The `ignore` attribute
223+
224+
Sometimes a few specific tests can be very time-consuming to execute. These
225+
can be disabled by default by using the `ignore` attribute:
226+
227+
```rust
228+
#[test]
229+
fn it_works() {
230+
assert_eq!(4, add_two(2));
231+
}
232+
233+
#[test]
234+
#[ignore]
235+
fn expensive_test() {
236+
// code that takes an hour to run
237+
}
238+
```
239+
240+
Now we run our tests and see that `it_works` is run, but `expensive_test` is
241+
not:
242+
243+
```bash
244+
$ cargo test
245+
Compiling adder v0.0.1 (file:///home/you/projects/adder)
246+
Running target/adder-91b3e234d4ed382a
247+
248+
running 2 tests
249+
test expensive_test ... ignored
250+
test it_works ... ok
251+
252+
test result: ok. 1 passed; 0 failed; 1 ignored; 0 measured
253+
254+
Doc-tests adder
255+
256+
running 0 tests
257+
258+
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
259+
```
260+
261+
The expensive tests can be run explicitly using `cargo test -- --ignored`:
262+
263+
```bash
264+
$ cargo test -- --ignored
265+
Running target/adder-91b3e234d4ed382a
266+
267+
running 1 test
268+
test expensive_test ... ok
269+
270+
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
271+
272+
Doc-tests adder
273+
274+
running 0 tests
275+
276+
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
277+
```
278+
279+
The `--ignored` argument is an argument to the test binary, and not to cargo,
280+
which is why the command is `cargo test -- --ignored`.
281+
222282
# The `tests` module
223283

224284
There is one way in which our existing example is not idiomatic: it's
@@ -355,8 +415,8 @@ Let's finally check out that third section: documentation tests.
355415
Nothing is better than documentation with examples. Nothing is worse than
356416
examples that don't actually work, because the code has changed since the
357417
documentation has been written. To this end, Rust supports automatically
358-
running examples in your documentation. Here's a fleshed-out `src/lib.rs`
359-
with examples:
418+
running examples in your documentation (**note:** this only works in library
419+
crates, not binary crates). Here's a fleshed-out `src/lib.rs` with examples:
360420

361421
```rust,ignore
362422
//! The `adder` crate provides functions that add numbers to other numbers.

branches/try/src/libcollections/string.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -806,11 +806,7 @@ impl<'a> Extend<&'a char> for String {
806806
#[stable(feature = "rust1", since = "1.0.0")]
807807
impl<'a> Extend<&'a str> for String {
808808
fn extend<I: IntoIterator<Item=&'a str>>(&mut self, iterable: I) {
809-
let iterator = iterable.into_iter();
810-
// A guess that at least one byte per iterator element will be needed.
811-
let (lower_bound, _) = iterator.size_hint();
812-
self.reserve(lower_bound);
813-
for s in iterator {
809+
for s in iterable {
814810
self.push_str(s)
815811
}
816812
}

branches/try/src/libcore/any.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
//!
1414
//! `Any` itself can be used to get a `TypeId`, and has more features when used
1515
//! as a trait object. As `&Any` (a borrowed trait object), it has the `is` and
16-
//! `as_ref` methods, to test if the contained value is of a given type, and to
17-
//! get a reference to the inner value as a type. As `&mut Any`, there is also
18-
//! the `as_mut` method, for getting a mutable reference to the inner value.
19-
//! `Box<Any>` adds the `move` method, which will unwrap a `Box<T>` from the
20-
//! object. See the extension traits (`*Ext`) for the full details.
16+
//! `downcast_ref` methods, to test if the contained value is of a given type,
17+
//! and to get a reference to the inner value as a type. As `&mut Any`, there
18+
//! is also the `downcast_mut` method, for getting a mutable reference to the
19+
//! inner value. `Box<Any>` adds the `move` method, which will unwrap a
20+
//! `Box<T>` from the object. See the extension traits (`*Ext`) for the full
21+
//! details.
2122
//!
2223
//! Note that &Any is limited to testing whether a value is of a specified
2324
//! concrete type, and cannot be used to test whether a type implements a trait.

branches/try/src/libcore/intrinsics.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,11 @@ extern "rust-intrinsic" {
247247
/// ```
248248
/// use std::mem;
249249
///
250-
/// let v: &[u8] = unsafe { mem::transmute("L") };
251-
/// assert!(v == [76]);
250+
/// let array: &[u8] = unsafe { mem::transmute("Rust") };
251+
/// assert_eq!(array, [82, 117, 115, 116]);
252252
/// ```
253253
#[stable(feature = "rust1", since = "1.0.0")]
254-
pub fn transmute<T,U>(e: T) -> U;
254+
pub fn transmute<T, U>(e: T) -> U;
255255

256256
/// Gives the address for the return value of the enclosing function.
257257
///

0 commit comments

Comments
 (0)