Skip to content

Commit a254aa2

Browse files
committed
---
yaml --- r: 172020 b: refs/heads/beta c: 44440e5 h: refs/heads/master v: v3
1 parent 1b3dd81 commit a254aa2

File tree

473 files changed

+5683
-4829
lines changed

Some content is hidden

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

473 files changed

+5683
-4829
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b5571ed71a5879c0495a982506258d5d267744ed
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: 5f27b500800fc2720c5caa4a0cd5dcc46c0b911f
34+
refs/heads/beta: 44440e5c18a1dbcc9685866ffffe00c508929079
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
108108
let matches =
109109
&match getopts::getopts(args_.as_slice(), groups.as_slice()) {
110110
Ok(m) => m,
111-
Err(f) => panic!("{}", f)
111+
Err(f) => panic!("{:?}", f)
112112
};
113113

114114
if matches.opt_present("h") || matches.opt_present("help") {
@@ -127,7 +127,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
127127
match regex::Regex::new(s) {
128128
Ok(re) => Some(re),
129129
Err(e) => {
130-
println!("failed to parse filter /{}/: {}", s, e);
130+
println!("failed to parse filter /{}/: {:?}", s, e);
131131
panic!()
132132
}
133133
}
@@ -186,11 +186,11 @@ pub fn parse_config(args: Vec<String> ) -> Config {
186186
pub fn log_config(config: &Config) {
187187
let c = config;
188188
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()));
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()));
194194
logv(c, format!("stage_id: {}", config.stage_id));
195195
logv(c, format!("mode: {}", config.mode));
196196
logv(c, format!("run_ignored: {}", config.run_ignored));
@@ -206,10 +206,10 @@ pub fn log_config(config: &Config) {
206206
logv(c, format!("jit: {}", config.jit));
207207
logv(c, format!("target: {}", config.target));
208208
logv(c, format!("host: {}", config.host));
209-
logv(c, format!("android-cross-path: {}",
209+
logv(c, format!("android-cross-path: {:?}",
210210
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));
211+
logv(c, format!("adb_path: {:?}", config.adb_path));
212+
logv(c, format!("adb_test_dir: {:?}", config.adb_test_dir));
213213
logv(c, format!("adb_device_status: {}",
214214
config.adb_device_status));
215215
match config.test_shard {
@@ -271,7 +271,7 @@ pub fn run_tests(config: &Config) {
271271
Ok(true) => {}
272272
Ok(false) => panic!("Some tests failed"),
273273
Err(e) => {
274-
println!("I/O failure during tests: {}", e);
274+
println!("I/O failure during tests: {:?}", e);
275275
}
276276
}
277277
}
@@ -299,13 +299,13 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
299299
}
300300

301301
pub fn make_tests(config: &Config) -> Vec<test::TestDescAndFn> {
302-
debug!("making tests from {}",
302+
debug!("making tests from {:?}",
303303
config.src_base.display());
304304
let mut tests = Vec::new();
305305
let dirs = fs::readdir(&config.src_base).unwrap();
306306
for file in dirs.iter() {
307307
let file = file.clone();
308-
debug!("inspecting file {}", file.display());
308+
debug!("inspecting file {:?}", file.display());
309309
if is_test(config, &file) {
310310
let t = make_test(config, &file, || {
311311
match config.mode {

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

Lines changed: 19 additions & 18 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,7 +443,7 @@ 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));
@@ -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,17 +539,18 @@ 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("\\", "\\\\"))[]);
545+
script_str.push_str(format!("file {}\n",
546+
exe_file.as_str().unwrap().replace("\\", "\\\\"))
547+
.as_slice());
547548

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

555556
script_str.push_str(cmds.as_slice());
@@ -675,7 +676,7 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
675676
.unwrap()
676677
.to_string();
677678

678-
script_str.push_str(&format!("command script import {}\n", &rust_pp_module_abs_path[])[]);
679+
script_str.push_str(format!("command script import {}\n", rust_pp_module_abs_path[])[]);
679680
script_str.push_str("type summary add --no-value ");
680681
script_str.push_str("--python-function lldb_rust_formatters.print_val ");
681682
script_str.push_str("-x \".*\" --category Rust\n");
@@ -888,7 +889,7 @@ fn check_error_patterns(props: &TestProps,
888889
output_to_check: &str,
889890
proc_res: &ProcRes) {
890891
if props.error_patterns.is_empty() {
891-
fatal(format!("no error pattern specified in {}",
892+
fatal(format!("no error pattern specified in {:?}",
892893
testfile.display()).as_slice());
893894
}
894895
let mut next_err_idx = 0u;
@@ -909,7 +910,7 @@ fn check_error_patterns(props: &TestProps,
909910
if done { return; }
910911

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

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

960961
#[cfg(windows)]
@@ -1190,7 +1191,7 @@ fn compose_and_run_compiler(
11901191
None);
11911192
if !auxres.status.success() {
11921193
fatal_proc_rec(
1193-
format!("auxiliary build of {} failed to compile: ",
1194+
format!("auxiliary build of {:?} failed to compile: ",
11941195
abs_ab.display()).as_slice(),
11951196
&auxres);
11961197
}
@@ -1600,7 +1601,7 @@ fn _arm_push_aux_shared_library(config: &Config, testfile: &Path) {
16001601
.expect(format!("failed to exec `{}`", config.adb_path).as_slice());
16011602

16021603
if config.verbose {
1603-
println!("push ({}) {} {} {}",
1604+
println!("push ({}) {:?} {} {}",
16041605
config.target, file.display(),
16051606
copy_result.out, copy_result.err);
16061607
}

branches/beta/src/liballoc/arc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ impl<T: Eq> Eq for Arc<T> {}
581581

582582
impl<T: fmt::Show> fmt::Show for Arc<T> {
583583
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
584-
(**self).fmt(f)
584+
write!(f, "Arc({:?})", (**self))
585585
}
586586
}
587587

@@ -794,7 +794,7 @@ mod tests {
794794
#[test]
795795
fn show_arc() {
796796
let a = Arc::new(5u32);
797-
assert!(format!("{}", a) == "5")
797+
assert!(format!("{:?}", a) == "Arc(5u32)")
798798
}
799799

800800
// Make sure deriving works with Arc<T>

branches/beta/src/liballoc/boxed.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,13 @@ impl BoxAny for Box<Any> {
145145

146146
impl<T: ?Sized + fmt::Show> fmt::Show for Box<T> {
147147
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
148-
(**self).fmt(f)
148+
write!(f, "Box({:?})", &**self)
149+
}
150+
}
151+
152+
impl<Sized? T: fmt::String> fmt::String for Box<T> {
153+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
154+
fmt::String::fmt(&**self, f)
149155
}
150156
}
151157

branches/beta/src/liballoc/rc.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ impl<S: hash::Writer, T: Hash<S>> Hash<S> for Rc<T> {
607607
#[experimental = "Show is experimental."]
608608
impl<T: fmt::Show> fmt::Show for Rc<T> {
609609
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
610-
(**self).fmt(f)
610+
write!(f, "Rc({:?})", **self)
611611
}
612612
}
613613

@@ -962,4 +962,10 @@ mod tests {
962962
assert!(cow1_weak.upgrade().is_none());
963963
}
964964

965+
#[test]
966+
fn test_show() {
967+
let foo = Rc::new(75u);
968+
assert!(format!("{:?}", foo) == "Rc(75u)")
969+
}
970+
965971
}

branches/beta/src/libcollections/bit.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ impl Bitv {
330330

331331
if extra_bytes > 0 {
332332
let mut last_word = 0u32;
333-
for (i, &byte) in bytes.index(&((complete_words*4)..)).iter().enumerate() {
333+
for (i, &byte) in bytes[complete_words*4..].iter().enumerate() {
334334
last_word |= (reverse_bits(byte) as u32) << (i * 8);
335335
}
336336
bitv.storage.push(last_word);
@@ -1729,13 +1729,13 @@ impl BitvSet {
17291729

17301730
impl fmt::Show for BitvSet {
17311731
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
1732-
try!(write!(fmt, "{{"));
1732+
try!(write!(fmt, "BitvSet {{"));
17331733
let mut first = true;
17341734
for n in self.iter() {
17351735
if !first {
17361736
try!(write!(fmt, ", "));
17371737
}
1738-
try!(write!(fmt, "{}", n));
1738+
try!(write!(fmt, "{:?}", n));
17391739
first = false;
17401740
}
17411741
write!(fmt, "}}")

branches/beta/src/libcollections/btree/map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -866,11 +866,11 @@ impl<K: Ord, V: Ord> Ord for BTreeMap<K, V> {
866866
#[stable]
867867
impl<K: Show, V: Show> Show for BTreeMap<K, V> {
868868
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
869-
try!(write!(f, "{{"));
869+
try!(write!(f, "BTreeMap {{"));
870870

871871
for (i, (k, v)) in self.iter().enumerate() {
872872
if i != 0 { try!(write!(f, ", ")); }
873-
try!(write!(f, "{}: {}", *k, *v));
873+
try!(write!(f, "{:?}: {:?}", *k, *v));
874874
}
875875

876876
write!(f, "}}")

branches/beta/src/libcollections/btree/node.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ impl<K: Clone, V: Clone> Clone for Node<K, V> {
493493
/// // Now the handle still points at index 75, but on the small node, which has no index 75.
494494
/// flag.set(true);
495495
///
496-
/// println!("Uninitialized memory: {}", handle.into_kv());
496+
/// println!("Uninitialized memory: {:?}", handle.into_kv());
497497
/// }
498498
/// ```
499499
#[derive(Copy)]

branches/beta/src/libcollections/btree/set.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,11 +556,11 @@ impl<'a, 'b, T: Ord + Clone> BitOr<&'b BTreeSet<T>> for &'a BTreeSet<T> {
556556
#[stable]
557557
impl<T: Show> Show for BTreeSet<T> {
558558
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
559-
try!(write!(f, "{{"));
559+
try!(write!(f, "BTreeSet {{"));
560560

561561
for (i, x) in self.iter().enumerate() {
562562
if i != 0 { try!(write!(f, ", ")); }
563-
try!(write!(f, "{}", *x));
563+
try!(write!(f, "{:?}", *x));
564564
}
565565

566566
write!(f, "}}")

branches/beta/src/libcollections/dlist.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,11 +663,11 @@ impl<A: Clone> Clone for DList<A> {
663663
#[stable]
664664
impl<A: fmt::Show> fmt::Show for DList<A> {
665665
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
666-
try!(write!(f, "["));
666+
try!(write!(f, "DList ["));
667667

668668
for (i, e) in self.iter().enumerate() {
669669
if i != 0 { try!(write!(f, ", ")); }
670-
try!(write!(f, "{}", *e));
670+
try!(write!(f, "{:?}", *e));
671671
}
672672

673673
write!(f, "]")

0 commit comments

Comments
 (0)