Skip to content

Commit 2f18395

Browse files
committed
---
yaml --- r: 194029 b: refs/heads/beta c: 420bf9d h: refs/heads/master i: 194027: b9bf252 v: v3
1 parent 70d00d0 commit 2f18395

File tree

140 files changed

+928
-1447
lines changed

Some content is hidden

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

140 files changed

+928
-1447
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: 3bdb5c3078a69becbf249739c8099ac9acb3513d
34+
refs/heads/beta: 420bf9dd44499e2480483fd7eb08998899cb6b8c
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: de8a23bbc3a7b9cbd7574b5b91a34af59bf030e6

branches/beta/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/beta/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 VARIABLES
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/beta/src/compiletest/compiletest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,15 +224,15 @@ pub fn run_tests(config: &Config) {
224224
// android debug-info test uses remote debugger
225225
// so, we test 1 task at once.
226226
// also trying to isolate problems with adb_run_wrapper.sh ilooping
227-
env::set_var("RUST_TEST_TASKS","1");
227+
env::set_var("RUST_TEST_THREADS","1");
228228
}
229229

230230
match config.mode {
231231
DebugInfoLldb => {
232232
// Some older versions of LLDB seem to have problems with multiple
233233
// instances running in parallel, so only run one test task at a
234234
// time.
235-
env::set_var("RUST_TEST_TASKS", "1");
235+
env::set_var("RUST_TEST_THREADS", "1");
236236
}
237237
_ => { /* proceed */ }
238238
}

branches/beta/src/compiletest/header.rs

Lines changed: 5 additions & 1 deletion
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")) &&

branches/beta/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/beta/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/beta/src/doc/trpl/SUMMARY.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
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)
1817
* [II: Intermediate Rust](intermediate.md)
1918
* [Crates and Modules](crates-and-modules.md)
2019
* [Testing](testing.md)

branches/beta/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

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ Foreign libraries often hand off ownership of resources to the calling code.
170170
When this occurs, we must use Rust's destructors to provide safety and guarantee
171171
the release of these resources (especially in the case of panic).
172172

173+
For more about destructors, see the [Drop trait](../std/ops/trait.Drop.html).
174+
173175
# Callbacks from C code to Rust functions
174176

175177
Some external libraries require the usage of callbacks to report back their

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,26 @@ let z = (8, 2, 6);
1414
```
1515

1616
In the example above `x` and `y` have arity 2. `z` has arity 3.
17+
18+
### Abstract Syntax Tree
19+
20+
When a compiler is compiling your program, it does a number of different
21+
things. One of the things that it does is turn the text of your program into an
22+
'abstract syntax tree,' or 'AST.' This tree is a representation of the
23+
structure of your program. For example, `2 + 3` can be turned into a tree:
24+
25+
```text
26+
+
27+
/ \
28+
2 3
29+
```
30+
31+
And `2 + (3 * 4)` would look like this:
32+
33+
```text
34+
+
35+
/ \
36+
2 *
37+
/ \
38+
3 4
39+
```

0 commit comments

Comments
 (0)