Skip to content

Commit 1c8f53d

Browse files
committed
---
yaml --- r: 171479 b: refs/heads/batch c: 26cd8ea h: refs/heads/master i: 171477: 802551e 171475: aa7b96b 171471: e85e0c5 v: v3
1 parent ae7ff91 commit 1c8f53d

File tree

716 files changed

+8394
-13571
lines changed

Some content is hidden

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

716 files changed

+8394
-13571
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2929
refs/heads/issue-18208-method-dispatch-2: 9e1eae4fb9b6527315b4441cf8a0f5ca911d1671
3030
refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
32-
refs/heads/batch: e9cbdd866d1c9c01e9affaf6875e37e58a073758
32+
refs/heads/batch: 26cd8eae48ea99bda183c5224bc423991ccfaf1f
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: 496dc4eae7de9d14cd49511a9acfbf5f11ae6c3f
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928

branches/batch/src/compiletest/common.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ impl FromStr for Mode {
4343
}
4444
}
4545

46-
impl fmt::Show for Mode {
46+
impl fmt::String for Mode {
4747
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
48-
let msg = match *self {
48+
fmt::String::fmt(match *self {
4949
CompileFail => "compile-fail",
5050
RunFail => "run-fail",
5151
RunPass => "run-pass",
@@ -54,8 +54,13 @@ impl fmt::Show for Mode {
5454
DebugInfoGdb => "debuginfo-gdb",
5555
DebugInfoLldb => "debuginfo-lldb",
5656
Codegen => "codegen",
57-
};
58-
msg.fmt(f)
57+
}, f)
58+
}
59+
}
60+
61+
impl fmt::Show for Mode {
62+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
63+
fmt::String::fmt(self, f)
5964
}
6065
}
6166

branches/batch/src/compiletest/compiletest.rs

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,8 @@
1616
extern crate test;
1717
extern crate getopts;
1818

19-
#[cfg(stage0)]
20-
#[phase(plugin, link)]
21-
extern crate log;
22-
23-
#[cfg(not(stage0))]
2419
#[macro_use]
2520
extern crate log;
26-
2721
extern crate regex;
2822

2923
use std::os;
@@ -108,7 +102,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
108102
let matches =
109103
&match getopts::getopts(args_.as_slice(), groups.as_slice()) {
110104
Ok(m) => m,
111-
Err(f) => panic!("{}", f)
105+
Err(f) => panic!("{:?}", f)
112106
};
113107

114108
if matches.opt_present("h") || matches.opt_present("help") {
@@ -127,7 +121,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
127121
match regex::Regex::new(s) {
128122
Ok(re) => Some(re),
129123
Err(e) => {
130-
println!("failed to parse filter /{}/: {}", s, e);
124+
println!("failed to parse filter /{}/: {:?}", s, e);
131125
panic!()
132126
}
133127
}
@@ -186,11 +180,11 @@ pub fn parse_config(args: Vec<String> ) -> Config {
186180
pub fn log_config(config: &Config) {
187181
let c = config;
188182
logv(c, format!("configuration:"));
189-
logv(c, format!("compile_lib_path: {}", config.compile_lib_path));
190-
logv(c, format!("run_lib_path: {}", config.run_lib_path));
191-
logv(c, format!("rustc_path: {}", config.rustc_path.display()));
192-
logv(c, format!("src_base: {}", config.src_base.display()));
193-
logv(c, format!("build_base: {}", config.build_base.display()));
183+
logv(c, format!("compile_lib_path: {:?}", config.compile_lib_path));
184+
logv(c, format!("run_lib_path: {:?}", config.run_lib_path));
185+
logv(c, format!("rustc_path: {:?}", config.rustc_path.display()));
186+
logv(c, format!("src_base: {:?}", config.src_base.display()));
187+
logv(c, format!("build_base: {:?}", config.build_base.display()));
194188
logv(c, format!("stage_id: {}", config.stage_id));
195189
logv(c, format!("mode: {}", config.mode));
196190
logv(c, format!("run_ignored: {}", config.run_ignored));
@@ -206,10 +200,10 @@ pub fn log_config(config: &Config) {
206200
logv(c, format!("jit: {}", config.jit));
207201
logv(c, format!("target: {}", config.target));
208202
logv(c, format!("host: {}", config.host));
209-
logv(c, format!("android-cross-path: {}",
203+
logv(c, format!("android-cross-path: {:?}",
210204
config.android_cross_path.display()));
211-
logv(c, format!("adb_path: {}", config.adb_path));
212-
logv(c, format!("adb_test_dir: {}", config.adb_test_dir));
205+
logv(c, format!("adb_path: {:?}", config.adb_path));
206+
logv(c, format!("adb_test_dir: {:?}", config.adb_test_dir));
213207
logv(c, format!("adb_device_status: {}",
214208
config.adb_device_status));
215209
match config.test_shard {
@@ -271,7 +265,7 @@ pub fn run_tests(config: &Config) {
271265
Ok(true) => {}
272266
Ok(false) => panic!("Some tests failed"),
273267
Err(e) => {
274-
println!("I/O failure during tests: {}", e);
268+
println!("I/O failure during tests: {:?}", e);
275269
}
276270
}
277271
}
@@ -299,13 +293,13 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
299293
}
300294

301295
pub fn make_tests(config: &Config) -> Vec<test::TestDescAndFn> {
302-
debug!("making tests from {}",
296+
debug!("making tests from {:?}",
303297
config.src_base.display());
304298
let mut tests = Vec::new();
305299
let dirs = fs::readdir(&config.src_base).unwrap();
306300
for file in dirs.iter() {
307301
let file = file.clone();
308-
debug!("inspecting file {}", file.display());
302+
debug!("inspecting file {:?}", file.display());
309303
if is_test(config, &file) {
310304
let t = make_test(config, &file, || {
311305
match config.mode {

branches/batch/src/compiletest/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ fn parse_expected(last_nonfollow_error: Option<uint>,
8484
(which, line)
8585
};
8686

87-
debug!("line={} which={} kind={} msg={}", line_num, which, kind, msg);
87+
debug!("line={} which={:?} kind={:?} msg={:?}", line_num, which, kind, msg);
8888
Some((which, ExpectedError { line: line,
8989
kind: kind,
9090
msg: msg, }))

branches/batch/src/compiletest/runtest.rs

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub fn run_metrics(config: Config, testfile: String, mm: &mut MetricMap) {
6161
print!("\n\n");
6262
}
6363
let testfile = Path::new(testfile);
64-
debug!("running {}", testfile.display());
64+
debug!("running {:?}", testfile.display());
6565
let props = header::load_props(&testfile);
6666
debug!("loaded props");
6767
match config.mode {
@@ -141,7 +141,7 @@ fn check_correct_failure_status(proc_res: &ProcRes) {
141141
static RUST_ERR: int = 101;
142142
if !proc_res.status.matches_exit_status(RUST_ERR) {
143143
fatal_proc_rec(
144-
format!("failure produced the wrong error: {}",
144+
format!("failure produced the wrong error: {:?}",
145145
proc_res.status).as_slice(),
146146
proc_res);
147147
}
@@ -410,7 +410,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
410410
],
411411
vec!(("".to_string(), "".to_string())),
412412
Some("".to_string()))
413-
.expect(format!("failed to exec `{}`", config.adb_path).as_slice());
413+
.expect(format!("failed to exec `{:?}`", config.adb_path).as_slice());
414414

415415
procsrv::run("",
416416
config.adb_path.as_slice(),
@@ -422,7 +422,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
422422
],
423423
vec!(("".to_string(), "".to_string())),
424424
Some("".to_string()))
425-
.expect(format!("failed to exec `{}`", config.adb_path).as_slice());
425+
.expect(format!("failed to exec `{:?}`", config.adb_path).as_slice());
426426

427427
let adb_arg = format!("export LD_LIBRARY_PATH={}; \
428428
gdbserver :5039 {}/{}",
@@ -443,11 +443,11 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
443443
vec!(("".to_string(),
444444
"".to_string())),
445445
Some("".to_string()))
446-
.expect(format!("failed to exec `{}`", config.adb_path).as_slice());
446+
.expect(format!("failed to exec `{:?}`", config.adb_path).as_slice());
447447
loop {
448448
//waiting 1 second for gdbserver start
449449
timer::sleep(Duration::milliseconds(1000));
450-
let result = Thread::spawn(move || {
450+
let result = Thread::scoped(move || {
451451
tcp::TcpStream::connect("127.0.0.1:5039").unwrap();
452452
}).join();
453453
if result.is_err() {
@@ -481,7 +481,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
481481
debugger_opts.as_slice(),
482482
vec!(("".to_string(), "".to_string())),
483483
None)
484-
.expect(format!("failed to exec `{}`", gdb_path).as_slice());
484+
.expect(format!("failed to exec `{:?}`", gdb_path).as_slice());
485485
let cmdline = {
486486
let cmdline = make_cmdline("",
487487
"arm-linux-androideabi-gdb",
@@ -539,18 +539,17 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
539539
script_str.push_str("set print pretty off\n");
540540

541541
// Add the pretty printer directory to GDB's source-file search path
542-
script_str.push_str(format!("directory {}\n", rust_pp_module_abs_path)[]);
542+
script_str.push_str(&format!("directory {}\n", rust_pp_module_abs_path)[]);
543543

544544
// Load the target executable
545-
script_str.push_str(format!("file {}\n",
546-
exe_file.as_str().unwrap().replace("\\", "\\\\"))
547-
.as_slice());
545+
script_str.push_str(&format!("file {}\n",
546+
exe_file.as_str().unwrap().replace("\\", "\\\\"))[]);
548547

549548
// Add line breakpoints
550549
for line in breakpoint_lines.iter() {
551-
script_str.push_str(format!("break '{}':{}\n",
552-
testfile.filename_display(),
553-
*line)[]);
550+
script_str.push_str(&format!("break '{:?}':{}\n",
551+
testfile.filename_display(),
552+
*line)[]);
554553
}
555554

556555
script_str.push_str(cmds.as_slice());
@@ -676,7 +675,7 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
676675
.unwrap()
677676
.to_string();
678677

679-
script_str.push_str(format!("command script import {}\n", rust_pp_module_abs_path[])[]);
678+
script_str.push_str(&format!("command script import {}\n", &rust_pp_module_abs_path[])[]);
680679
script_str.push_str("type summary add --no-value ");
681680
script_str.push_str("--python-function lldb_rust_formatters.print_val ");
682681
script_str.push_str("-x \".*\" --category Rust\n");
@@ -889,7 +888,7 @@ fn check_error_patterns(props: &TestProps,
889888
output_to_check: &str,
890889
proc_res: &ProcRes) {
891890
if props.error_patterns.is_empty() {
892-
fatal(format!("no error pattern specified in {}",
891+
fatal(format!("no error pattern specified in {:?}",
893892
testfile.display()).as_slice());
894893
}
895894
let mut next_err_idx = 0u;
@@ -910,7 +909,7 @@ fn check_error_patterns(props: &TestProps,
910909
if done { return; }
911910

912911
let missing_patterns =
913-
props.error_patterns[next_err_idx..];
912+
props.error_patterns.index(&(next_err_idx..));
914913
if missing_patterns.len() == 1u {
915914
fatal_proc_rec(format!("error pattern '{}' not found!",
916915
missing_patterns[0]).as_slice(),
@@ -955,7 +954,7 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
955954
}
956955

957956
let prefixes = expected_errors.iter().map(|ee| {
958-
format!("{}:{}:", testfile.display(), ee.line)
957+
format!("{:?}:{}:", testfile.display(), ee.line)
959958
}).collect::<Vec<String> >();
960959

961960
#[cfg(windows)]
@@ -1191,7 +1190,7 @@ fn compose_and_run_compiler(
11911190
None);
11921191
if !auxres.status.success() {
11931192
fatal_proc_rec(
1194-
format!("auxiliary build of {} failed to compile: ",
1193+
format!("auxiliary build of {:?} failed to compile: ",
11951194
abs_ab.display()).as_slice(),
11961195
&auxres);
11971196
}
@@ -1601,7 +1600,7 @@ fn _arm_push_aux_shared_library(config: &Config, testfile: &Path) {
16011600
.expect(format!("failed to exec `{}`", config.adb_path).as_slice());
16021601

16031602
if config.verbose {
1604-
println!("push ({}) {} {} {}",
1603+
println!("push ({}) {:?} {} {}",
16051604
config.target, file.display(),
16061605
copy_result.out, copy_result.err);
16071606
}

branches/batch/src/doc/guide-unsafe.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,10 +703,10 @@ Other features provided by lang items include:
703703
`deref`, and `add` respectively.
704704
- stack unwinding and general failure; the `eh_personality`, `fail`
705705
and `fail_bounds_checks` lang items.
706-
- the traits in `std::kinds` used to indicate types that satisfy
706+
- the traits in `std::markers` used to indicate types of
707707
various kinds; lang items `send`, `sync` and `copy`.
708708
- the marker types and variance indicators found in
709-
`std::kinds::markers`; lang items `covariant_type`,
709+
`std::markers`; lang items `covariant_type`,
710710
`contravariant_lifetime`, `no_sync_bound`, etc.
711711

712712
Lang items are loaded lazily by the compiler; e.g. if one never uses

branches/batch/src/doc/intro.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ fn main() {
395395
for _ in range(0u, 10u) {
396396
Thread::spawn(move || {
397397
println!("Hello, world!");
398-
}).detach();
398+
});
399399
}
400400
}
401401
```
@@ -405,8 +405,7 @@ This program creates ten threads, who all print `Hello, world!`. The
405405
double bars `||`. (The `move` keyword indicates that the closure takes
406406
ownership of any data it uses; we'll have more on the significance of
407407
this shortly.) This closure is executed in a new thread created by
408-
`spawn`. The `detach` method means that the child thread is allowed to
409-
outlive its parent.
408+
`spawn`.
410409
411410
One common form of problem in concurrent programs is a 'data race.'
412411
This occurs when two different threads attempt to access the same
@@ -429,7 +428,7 @@ fn main() {
429428
for i in range(0u, 3u) {
430429
Thread::spawn(move || {
431430
for j in range(0, 3) { numbers[j] += 1 }
432-
}).detach();
431+
});
433432
}
434433
}
435434
```
@@ -488,7 +487,7 @@ fn main() {
488487
(*array)[i] += 1;
489488
490489
println!("numbers[{}] is {}", i, (*array)[i]);
491-
}).detach();
490+
});
492491
}
493492
}
494493
```

branches/batch/src/doc/reference.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -690,10 +690,9 @@ balanced, but they are otherwise not special.
690690

691691
In the matcher, `$` _name_ `:` _designator_ matches the nonterminal in the Rust
692692
syntax named by _designator_. Valid designators are `item`, `block`, `stmt`,
693-
`pat`, `expr`, `ty` (type), `ident`, `path`, `matchers` (lhs of the `=>` in
694-
macro rules), `tt` (rhs of the `=>` in macro rules). In the transcriber, the
695-
designator is already known, and so only the name of a matched nonterminal
696-
comes after the dollar sign.
693+
`pat`, `expr`, `ty` (type), `ident`, `path`, `tt` (either side of the `=>`
694+
in macro rules). In the transcriber, the designator is already known, and so
695+
only the name of a matched nonterminal comes after the dollar sign.
697696

698697
In both the matcher and transcriber, the Kleene star-like operator indicates
699698
repetition. The Kleene star operator consists of `$` and parens, optionally

branches/batch/src/etc/gdb_rust_pretty_printing.py

100644100755
Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def rust_pretty_printer_lookup_function(val):
5151
enum_member_count = len(enum_members)
5252

5353
if enum_member_count == 0:
54-
return RustStructPrinter(val, false)
54+
return RustStructPrinter(val, False)
5555

5656
if enum_member_count == 1:
5757
first_variant_name = enum_members[0].name
@@ -60,21 +60,27 @@ def rust_pretty_printer_lookup_function(val):
6060
return rust_pretty_printer_lookup_function(val[enum_members[0]])
6161
else:
6262
assert first_variant_name.startswith("RUST$ENCODED$ENUM$")
63-
# This is a space-optimized enum
63+
# This is a space-optimized enum.
64+
# This means this enum has only two states, and Rust uses one of the
65+
# fields somewhere in the struct to determine which of the two states
66+
# it's in. The location of the field is encoded in the name as something
67+
# like RUST$ENCODED$ENUM$(num$)*name_of_zero_state
6468
last_separator_index = first_variant_name.rfind("$")
65-
second_last_separator_index = first_variant_name.rfind("$", 0, last_separator_index)
66-
disr_field_index = first_variant_name[second_last_separator_index + 1 :
67-
last_separator_index]
68-
disr_field_index = int(disr_field_index)
69+
start_index = len("RUST$ENCODED$ENUM$")
70+
disr_field_indices = first_variant_name[start_index :
71+
last_separator_index].split("$")
72+
disr_field_indices = [int(index) for index in disr_field_indices]
6973

7074
sole_variant_val = val[enum_members[0]]
71-
disr_field = get_field_at_index(sole_variant_val, disr_field_index)
72-
discriminant = sole_variant_val[disr_field]
75+
discriminant = sole_variant_val
76+
for disr_field_index in disr_field_indices:
77+
disr_field = get_field_at_index(discriminant, disr_field_index)
78+
discriminant = discriminant[disr_field]
7379

7480
# If the discriminant field is a fat pointer we have to consider the
7581
# first word as the true discriminant
7682
if discriminant.type.code == gdb.TYPE_CODE_STRUCT:
77-
discriminant = discriminant[get_field_at_index(discriminant, 0)]
83+
discriminant = discriminant[get_field_at_index(discriminant, 0)]
7884

7985
if discriminant == 0:
8086
null_variant_name = first_variant_name[last_separator_index + 1:]
@@ -234,4 +240,5 @@ def get_field_at_index(val, index):
234240
for field in val.type.fields():
235241
if i == index:
236242
return field
243+
i += 1
237244
return None

0 commit comments

Comments
 (0)