Skip to content

Commit ebeff18

Browse files
author
Sae-bom Kim
committed
---
yaml --- r: 194011 b: refs/heads/beta c: 0ed265e h: refs/heads/master i: 194009: 2581ff3 194007: e2bc1fa v: v3
1 parent 9c3e586 commit ebeff18

File tree

170 files changed

+5126
-2700
lines changed

Some content is hidden

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

170 files changed

+5126
-2700
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: ecdf792d1dda479d04781e5750737aa6cc574119
34+
refs/heads/beta: 0ed265e63b130a52255031f593786bebdbc7f28d
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: de8a23bbc3a7b9cbd7574b5b91a34af59bf030e6

branches/beta/Makefile.in

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,12 @@
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_THREADS=1
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
101106
#
102107
# If you really feel like getting your hands dirty, then:
103108
#

branches/beta/man/rustc.1

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -242,28 +242,6 @@ 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-
267245
.SH "EXAMPLES"
268246
To build an executable from a source file with a main function:
269247
$ rustc \-o hello hello.rs

branches/beta/src/compiletest/compiletest.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#![feature(unboxed_closures)]
2020
#![feature(std_misc)]
2121
#![feature(test)]
22+
#![feature(core)]
2223
#![feature(path_ext)]
2324

2425
#![deny(warnings)]
@@ -224,15 +225,15 @@ pub fn run_tests(config: &Config) {
224225
// android debug-info test uses remote debugger
225226
// so, we test 1 task at once.
226227
// also trying to isolate problems with adb_run_wrapper.sh ilooping
227-
env::set_var("RUST_TEST_THREADS","1");
228+
env::set_var("RUST_TEST_TASKS","1");
228229
}
229230

230231
match config.mode {
231232
DebugInfoLldb => {
232233
// Some older versions of LLDB seem to have problems with multiple
233234
// instances running in parallel, so only run one test task at a
234235
// time.
235-
env::set_var("RUST_TEST_THREADS", "1");
236+
env::set_var("RUST_TEST_TASKS", "1");
236237
}
237238
_ => { /* proceed */ }
238239
}

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_THREADS"] {
134+
for key in vec!["RUST_TEST_NOCAPTURE", "RUST_TEST_TASKS"] {
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/runtest.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,22 +1052,22 @@ fn scan_char(haystack: &str, needle: char, idx: &mut uint) -> bool {
10521052
if *idx >= haystack.len() {
10531053
return false;
10541054
}
1055-
let ch = haystack.char_at(*idx);
1056-
if ch != needle {
1055+
let range = haystack.char_range_at(*idx);
1056+
if range.ch != needle {
10571057
return false;
10581058
}
1059-
*idx += ch.len_utf8();
1059+
*idx = range.next;
10601060
return true;
10611061
}
10621062

10631063
fn scan_integer(haystack: &str, idx: &mut uint) -> bool {
10641064
let mut i = *idx;
10651065
while i < haystack.len() {
1066-
let ch = haystack.char_at(i);
1067-
if ch < '0' || '9' < ch {
1066+
let range = haystack.char_range_at(i);
1067+
if range.ch < '0' || '9' < range.ch {
10681068
break;
10691069
}
1070-
i += ch.len_utf8();
1070+
i = range.next;
10711071
}
10721072
if i == *idx {
10731073
return false;
@@ -1083,9 +1083,9 @@ fn scan_string(haystack: &str, needle: &str, idx: &mut uint) -> bool {
10831083
if haystack_i >= haystack.len() {
10841084
return false;
10851085
}
1086-
let ch = haystack.char_at(haystack_i);
1087-
haystack_i += ch.len_utf8();
1088-
if !scan_char(needle, ch, &mut needle_i) {
1086+
let range = haystack.char_range_at(haystack_i);
1087+
haystack_i = range.next;
1088+
if !scan_char(needle, range.ch, &mut needle_i) {
10891089
return false;
10901090
}
10911091
}

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/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2068,7 +2068,7 @@ type int8_t = i8;
20682068
item](#language-items) for more details.
20692069
- `test` - indicates that this function is a test function, to only be compiled
20702070
in case of `--test`.
2071-
- `should_panic` - indicates that this test function should panic, inverting the success condition.
2071+
- `should_fail` - indicates that this test function should panic, inverting the success condition.
20722072
- `cold` - The function is unlikely to be executed, so optimize it (and calls
20732073
to it) differently.
20742074

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

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

branches/beta/src/doc/trpl/advanced-macros.md

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

88
Even when Rust code contains un-expanded macros, it can be parsed as a full
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
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.
1412

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

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -562,11 +562,6 @@ place in the hierarchy instead. There's one more special form of `use`: you can
562562
people like to think of `self` as `.` and `super` as `..`, from many shells'
563563
display for the current directory and the parent directory.
564564
565-
Outside of `use`, paths are relative: `foo::bar()` refers to a function inside
566-
of `foo` relative to where we are. If that's prefixed with `::`, as in
567-
`::foo::bar()`, it refers to a different `foo`, an absolute path from your
568-
crate root.
569-
570565
Also, note that we `pub use`d before we declared our `mod`s. Rust requires that
571566
`use` declarations go first.
572567

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,6 @@ 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-
175173
# Callbacks from C code to Rust functions
176174

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ Because this function will cause a crash, it will never return, and so it has
179179
the type '`!`', which is read "diverges." A diverging function can be used
180180
as any type:
181181

182-
```should_panic
182+
```should_fail
183183
# fn diverges() -> ! {
184184
# panic!("This function never returns!");
185185
# }

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

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,3 @@ 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)