Skip to content

Commit cfcb16f

Browse files
committed
---
yaml --- r: 191975 b: refs/heads/snap-stage3 c: b97e1cc h: refs/heads/master i: 191973: b3d5b47 191971: c1169c1 191967: 9c3e39a v: v3
1 parent fa1d330 commit cfcb16f

File tree

239 files changed

+2995
-2121
lines changed

Some content is hidden

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

239 files changed

+2995
-2121
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: 809a554fca2d0ebc2ba50077016fe282a4064752
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 9231ceb6dd273d8101e1b3906e6060f802e6423d
4+
refs/heads/snap-stage3: b97e1cc28e0d3fe6a745a02a7c1750564a090f34
55
refs/heads/try: ce76bff75603a754d092456285ff455eb871633d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/Makefile.in

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,7 @@
9797
# make check-stage1-rpass TESTNAME=my-shiny-new-test
9898
#
9999
# // Having trouble figuring out which test is failing? Turn off parallel tests
100-
# make check-stage1-std RUST_TEST_TASKS=1
101-
#
102-
# This is hardly all there is to know of The Rust Build System's
103-
# mysteries. The tale continues on the wiki[1].
104-
#
105-
# [1]: https://github.com/rust-lang/rust/wiki/Note-testsuite
100+
# make check-stage1-std RUST_TEST_THREADS=1
106101
#
107102
# If you really feel like getting your hands dirty, then:
108103
#

branches/snap-stage3/man/rustc.1

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,28 @@ full debug info with variable and type information.
242242
\fBopt\-level\fR=\fIVAL\fR
243243
Optimize with possible levels 0\[en]3
244244

245+
.SH ENVIRONMENT
246+
247+
Some of these affect the output of the compiler, while others affect programs
248+
which link to the standard library.
249+
250+
.TP
251+
\fBRUST_TEST_THREADS\fR
252+
The test framework Rust provides executes tests in parallel. This variable sets
253+
the maximum number of threads used for this purpose.
254+
255+
.TP
256+
\fBRUST_TEST_NOCAPTURE\fR
257+
A synonym for the --nocapture flag.
258+
259+
.TP
260+
\fBRUST_MIN_STACK\fR
261+
Sets the minimum stack size for new threads.
262+
263+
.TP
264+
\fBRUST_BACKTRACE\fR
265+
If set, produces a backtrace in the output of a program which panics.
266+
245267
.SH "EXAMPLES"
246268
To build an executable from a source file with a main function:
247269
$ rustc \-o hello hello.rs

branches/snap-stage3/src/compiletest/compiletest.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#![feature(std_misc)]
2121
#![feature(test)]
2222
#![feature(path_ext)]
23+
#![feature(convert)]
24+
#![feature(str_char)]
2325

2426
#![deny(warnings)]
2527

@@ -115,7 +117,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
115117

116118
fn opt_path(m: &getopts::Matches, nm: &str) -> PathBuf {
117119
match m.opt_str(nm) {
118-
Some(s) => PathBuf::new(&s),
120+
Some(s) => PathBuf::from(&s),
119121
None => panic!("no option (=path) found for {}", nm),
120122
}
121123
}
@@ -130,18 +132,18 @@ pub fn parse_config(args: Vec<String> ) -> Config {
130132
compile_lib_path: matches.opt_str("compile-lib-path").unwrap(),
131133
run_lib_path: matches.opt_str("run-lib-path").unwrap(),
132134
rustc_path: opt_path(matches, "rustc-path"),
133-
clang_path: matches.opt_str("clang-path").map(|s| PathBuf::new(&s)),
135+
clang_path: matches.opt_str("clang-path").map(|s| PathBuf::from(&s)),
134136
valgrind_path: matches.opt_str("valgrind-path"),
135137
force_valgrind: matches.opt_present("force-valgrind"),
136-
llvm_bin_path: matches.opt_str("llvm-bin-path").map(|s| PathBuf::new(&s)),
138+
llvm_bin_path: matches.opt_str("llvm-bin-path").map(|s| PathBuf::from(&s)),
137139
src_base: opt_path(matches, "src-base"),
138140
build_base: opt_path(matches, "build-base"),
139141
aux_base: opt_path(matches, "aux-base"),
140142
stage_id: matches.opt_str("stage-id").unwrap(),
141143
mode: matches.opt_str("mode").unwrap().parse().ok().expect("invalid mode"),
142144
run_ignored: matches.opt_present("ignored"),
143145
filter: filter,
144-
logfile: matches.opt_str("logfile").map(|s| PathBuf::new(&s)),
146+
logfile: matches.opt_str("logfile").map(|s| PathBuf::from(&s)),
145147
runtool: matches.opt_str("runtool"),
146148
host_rustcflags: matches.opt_str("host-rustcflags"),
147149
target_rustcflags: matches.opt_str("target-rustcflags"),
@@ -224,15 +226,15 @@ pub fn run_tests(config: &Config) {
224226
// android debug-info test uses remote debugger
225227
// so, we test 1 task at once.
226228
// also trying to isolate problems with adb_run_wrapper.sh ilooping
227-
env::set_var("RUST_TEST_TASKS","1");
229+
env::set_var("RUST_TEST_THREADS","1");
228230
}
229231

230232
match config.mode {
231233
DebugInfoLldb => {
232234
// Some older versions of LLDB seem to have problems with multiple
233235
// instances running in parallel, so only run one test task at a
234236
// time.
235-
env::set_var("RUST_TEST_TASKS", "1");
237+
env::set_var("RUST_TEST_THREADS", "1");
236238
}
237239
_ => { /* proceed */ }
238240
}

branches/snap-stage3/src/compiletest/header.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
131131
true
132132
});
133133

134-
for key in vec!["RUST_TEST_NOCAPTURE", "RUST_TEST_TASKS"] {
134+
for key in vec!["RUST_TEST_NOCAPTURE", "RUST_TEST_THREADS"] {
135135
match env::var(key) {
136136
Ok(val) =>
137137
if exec_env.iter().find(|&&(ref x, _)| *x == key.to_string()).is_none() {
@@ -163,6 +163,9 @@ pub fn is_test_ignored(config: &Config, testfile: &Path) -> bool {
163163
fn ignore_target(config: &Config) -> String {
164164
format!("ignore-{}", util::get_os(&config.target))
165165
}
166+
fn ignore_architecture(config: &Config) -> String {
167+
format!("ignore-{}", util::get_arch(&config.target))
168+
}
166169
fn ignore_stage(config: &Config) -> String {
167170
format!("ignore-{}",
168171
config.stage_id.split('-').next().unwrap())
@@ -226,6 +229,7 @@ pub fn is_test_ignored(config: &Config, testfile: &Path) -> bool {
226229
let val = iter_header(testfile, &mut |ln| {
227230
!parse_name_directive(ln, "ignore-test") &&
228231
!parse_name_directive(ln, &ignore_target(config)) &&
232+
!parse_name_directive(ln, &ignore_architecture(config)) &&
229233
!parse_name_directive(ln, &ignore_stage(config)) &&
230234
!(config.mode == common::Pretty && parse_name_directive(ln, "ignore-pretty")) &&
231235
!(config.target != config.host && parse_name_directive(ln, "ignore-cross-compile")) &&
@@ -324,10 +328,10 @@ fn parse_exec_env(line: &str) -> Option<(String, String)> {
324328

325329
fn parse_pp_exact(line: &str, testfile: &Path) -> Option<PathBuf> {
326330
match parse_name_value_directive(line, "pp-exact") {
327-
Some(s) => Some(PathBuf::new(&s)),
331+
Some(s) => Some(PathBuf::from(&s)),
328332
None => {
329333
if parse_name_directive(line, "pp-exact") {
330-
testfile.file_name().map(|s| PathBuf::new(s))
334+
testfile.file_name().map(|s| PathBuf::from(s))
331335
} else {
332336
None
333337
}

branches/snap-stage3/src/compiletest/procsrv.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010

1111
#![allow(deprecated)] // for old path, for dynamic_lib
1212

13-
use std::process::{ExitStatus, Command, Child, Output, Stdio};
14-
use std::io::prelude::*;
1513
use std::dynamic_lib::DynamicLibrary;
14+
use std::io::prelude::*;
15+
use std::old_path::Path;
16+
use std::process::{ExitStatus, Command, Child, Output, Stdio};
1617

1718
fn add_target_env(cmd: &mut Command, lib_path: &str, aux_path: Option<&str>) {
1819
// Need to be sure to put both the lib_path and the aux path in the dylib

branches/snap-stage3/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,7 @@ fn aux_output_dir_name(config: &Config, testfile: &Path) -> PathBuf {
14401440
}
14411441

14421442
fn output_testname(testfile: &Path) -> PathBuf {
1443-
PathBuf::new(testfile.file_stem().unwrap())
1443+
PathBuf::from(testfile.file_stem().unwrap())
14441444
}
14451445

14461446
fn output_base_name(config: &Config, testfile: &Path) -> PathBuf {

branches/snap-stage3/src/compiletest/util.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,23 @@ const OS_TABLE: &'static [(&'static str, &'static str)] = &[
2525
("openbsd", "openbsd"),
2626
];
2727

28+
const ARCH_TABLE: &'static [(&'static str, &'static str)] = &[
29+
("i386", "x86"),
30+
("i686", "x86"),
31+
("amd64", "x86_64"),
32+
("x86_64", "x86_64"),
33+
("sparc", "sparc"),
34+
("powerpc", "powerpc"),
35+
("arm64", "aarch64"),
36+
("arm", "arm"),
37+
("aarch64", "aarch64"),
38+
("mips", "mips"),
39+
("xcore", "xcore"),
40+
("msp430", "msp430"),
41+
("hexagon", "hexagon"),
42+
("s390x", "systemz"),
43+
];
44+
2845
pub fn get_os(triple: &str) -> &'static str {
2946
for &(triple_os, os) in OS_TABLE {
3047
if triple.contains(triple_os) {
@@ -33,6 +50,14 @@ pub fn get_os(triple: &str) -> &'static str {
3350
}
3451
panic!("Cannot determine OS from triple");
3552
}
53+
pub fn get_arch(triple: &str) -> &'static str {
54+
for &(triple_arch, arch) in ARCH_TABLE {
55+
if triple.contains(triple_arch) {
56+
return arch
57+
}
58+
}
59+
panic!("Cannot determine Architecture from triple");
60+
}
3661

3762
pub fn make_new_path(path: &str) -> String {
3863
assert!(cfg!(windows));

branches/snap-stage3/src/doc/reference.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,7 +1982,7 @@ the namespace hierarchy as it normally would.
19821982
## Attributes
19831983

19841984
```{.ebnf .gram}
1985-
attribute : "#!" ? '[' meta_item ']' ;
1985+
attribute : '#' '!' ? '[' meta_item ']' ;
19861986
meta_item : ident [ '=' literal
19871987
| '(' meta_seq ')' ] ? ;
19881988
meta_seq : meta_item [ ',' meta_seq ] ? ;
@@ -3158,7 +3158,7 @@ ten_times(|j| println!("hello, {}", j));
31583158
### While loops
31593159

31603160
```{.ebnf .gram}
3161-
while_expr : "while" no_struct_literal_expr '{' block '}' ;
3161+
while_expr : [ lifetime ':' ] "while" no_struct_literal_expr '{' block '}' ;
31623162
```
31633163

31643164
A `while` loop begins by evaluating the boolean loop conditional expression.
@@ -3223,7 +3223,7 @@ A `continue` expression is only permitted in the body of a loop.
32233223
### For expressions
32243224

32253225
```{.ebnf .gram}
3226-
for_expr : "for" pat "in" no_struct_literal_expr '{' block '}' ;
3226+
for_expr : [ lifetime ':' ] "for" pat "in" no_struct_literal_expr '{' block '}' ;
32273227
```
32283228

32293229
A `for` expression is a syntactic construct for looping over elements provided

branches/snap-stage3/src/doc/trpl/SUMMARY.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Summary
22

3-
* [I: The Basics](basic.md)
3+
* [The Basics](basic.md)
44
* [Installing Rust](installing-rust.md)
55
* [Hello, world!](hello-world.md)
66
* [Hello, Cargo!](hello-cargo.md)
@@ -14,8 +14,7 @@
1414
* [Strings](strings.md)
1515
* [Arrays, Vectors, and Slices](arrays-vectors-and-slices.md)
1616
* [Standard Input](standard-input.md)
17-
* [Guessing Game](guessing-game.md)
18-
* [II: Intermediate Rust](intermediate.md)
17+
* [Intermediate Rust](intermediate.md)
1918
* [Crates and Modules](crates-and-modules.md)
2019
* [Testing](testing.md)
2120
* [Pointers](pointers.md)
@@ -32,7 +31,7 @@
3231
* [Concurrency](concurrency.md)
3332
* [Error Handling](error-handling.md)
3433
* [Documentation](documentation.md)
35-
* [III: Advanced Topics](advanced.md)
34+
* [Advanced Topics](advanced.md)
3635
* [FFI](ffi.md)
3736
* [Unsafe Code](unsafe.md)
3837
* [Advanced Macros](advanced-macros.md)

branches/snap-stage3/src/doc/trpl/advanced-macros.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ off.
66
# Syntactic requirements
77

88
Even when Rust code contains un-expanded macros, it can be parsed as a full
9-
syntax tree. This property can be very useful for editors and other tools that
10-
process code. It also has a few consequences for the design of Rust's macro
11-
system.
9+
[syntax tree][ast]. This property can be very useful for editors and other
10+
tools that process code. It also has a few consequences for the design of
11+
Rust's macro system.
12+
13+
[ast]: glossary.html#abstract-syntax-tree
1214

1315
One consequence is that Rust must determine, when it parses a macro invocation,
1416
whether the macro stands in for

0 commit comments

Comments
 (0)