Skip to content

Commit 069e032

Browse files
committed
---
yaml --- r: 83605 b: refs/heads/try c: 73c6c91 h: refs/heads/master i: 83603: ed7b78c v: v3
1 parent 4ec2c2b commit 069e032

14 files changed

+56
-55
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 0e4d1fc8cae42e15e00f71d9f439b01bb25a86ae
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6c08cc2db4f98e9f07ae7d50338396c4123c2f0a
5-
refs/heads/try: 02054ac8a1490211a5a6873fdefe186bd0758b7b
5+
refs/heads/try: 73c6c9109fb334edf159ad08f67cc2e66c7035a5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/test/bench/core-set.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ fn write_header(header: &str) {
128128
}
129129

130130
fn write_row(label: &str, value: float) {
131-
io::stdout().write_str(fmt!("%30s %f s\n", label, value));
131+
io::stdout().write_str(format!("{:30s} {} s\n", label, value));
132132
}
133133

134134
fn write_results(label: &str, results: &Results) {

branches/try/src/test/bench/core-std.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ fn is_utf8_ascii() {
133133
for _ in range(0u, 20000) {
134134
v.push('b' as u8);
135135
if !str::is_utf8(v) {
136-
fail!("is_utf8 failed");
136+
fail2!("is_utf8 failed");
137137
}
138138
}
139139
}
@@ -144,7 +144,7 @@ fn is_utf8_multibyte() {
144144
for _ in range(0u, 5000) {
145145
v.push_all(s.as_bytes());
146146
if !str::is_utf8(v) {
147-
fail!("is_utf8 failed");
147+
fail2!("is_utf8 failed");
148148
}
149149
}
150150
}

branches/try/src/test/bench/core-uint-to-str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ fn main() {
2525

2626
for i in range(0u, n) {
2727
let x = i.to_str();
28-
info!(x);
28+
info2!("{}", x);
2929
}
3030
}

branches/try/src/test/bench/msgsend-pipes-shared.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ fn server(requests: &Port<request>, responses: &Chan<uint>) {
4242
match requests.try_recv() {
4343
Some(get_count) => { responses.send(count.clone()); }
4444
Some(bytes(b)) => {
45-
//error!("server: received %? bytes", b);
45+
//error2!("server: received {:?} bytes", b);
4646
count += b;
4747
}
4848
None => { done = true; }
4949
_ => { }
5050
}
5151
}
5252
responses.send(count);
53-
//error!("server exiting");
53+
//error2!("server exiting");
5454
}
5555

5656
fn run(args: &[~str]) {
@@ -70,10 +70,10 @@ fn run(args: &[~str]) {
7070
builder.future_result(|r| worker_results.push(r));
7171
do builder.spawn {
7272
for _ in range(0u, size / workers) {
73-
//error!("worker %?: sending %? bytes", i, num_bytes);
73+
//error2!("worker {:?}: sending {:?} bytes", i, num_bytes);
7474
to_child.send(bytes(num_bytes));
7575
}
76-
//error!("worker %? exiting", i);
76+
//error2!("worker {:?} exiting", i);
7777
}
7878
}
7979
do task::spawn || {
@@ -84,16 +84,16 @@ fn run(args: &[~str]) {
8484
r.recv();
8585
}
8686

87-
//error!("sending stop message");
87+
//error2!("sending stop message");
8888
to_child.send(stop);
8989
move_out(to_child);
9090
let result = from_child.recv();
9191
let end = extra::time::precise_time_s();
9292
let elapsed = end - start;
93-
io::stdout().write_str(fmt!("Count is %?\n", result));
94-
io::stdout().write_str(fmt!("Test took %? seconds\n", elapsed));
93+
io::stdout().write_str(format!("Count is {:?}\n", result));
94+
io::stdout().write_str(format!("Test took {:?} seconds\n", elapsed));
9595
let thruput = ((size / workers * workers) as float) / (elapsed as float);
96-
io::stdout().write_str(fmt!("Throughput=%f per sec\n", thruput));
96+
io::stdout().write_str(format!("Throughput={} per sec\n", thruput));
9797
assert_eq!(result, num_bytes * size);
9898
}
9999

@@ -107,6 +107,6 @@ fn main() {
107107
args.clone()
108108
};
109109

110-
info!("%?", args);
110+
info2!("{:?}", args);
111111
run(args);
112112
}

branches/try/src/test/bench/msgsend-pipes.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ fn server(requests: &Port<request>, responses: &Chan<uint>) {
3737
match requests.try_recv() {
3838
Some(get_count) => { responses.send(count.clone()); }
3939
Some(bytes(b)) => {
40-
//error!("server: received %? bytes", b);
40+
//error2!("server: received {:?} bytes", b);
4141
count += b;
4242
}
4343
None => { done = true; }
4444
_ => { }
4545
}
4646
}
4747
responses.send(count);
48-
//error!("server exiting");
48+
//error2!("server exiting");
4949
}
5050

5151
fn run(args: &[~str]) {
@@ -64,10 +64,10 @@ fn run(args: &[~str]) {
6464
builder.future_result(|r| worker_results.push(r));
6565
do builder.spawn {
6666
for _ in range(0u, size / workers) {
67-
//error!("worker %?: sending %? bytes", i, num_bytes);
67+
//error2!("worker {:?}: sending {:?} bytes", i, num_bytes);
6868
to_child.send(bytes(num_bytes));
6969
}
70-
//error!("worker %? exiting", i);
70+
//error2!("worker {:?} exiting", i);
7171
};
7272
}
7373
do task::spawn || {
@@ -78,16 +78,16 @@ fn run(args: &[~str]) {
7878
r.recv();
7979
}
8080

81-
//error!("sending stop message");
81+
//error2!("sending stop message");
8282
to_child.send(stop);
8383
move_out(to_child);
8484
let result = from_child.recv();
8585
let end = extra::time::precise_time_s();
8686
let elapsed = end - start;
87-
io::stdout().write_str(fmt!("Count is %?\n", result));
88-
io::stdout().write_str(fmt!("Test took %? seconds\n", elapsed));
87+
io::stdout().write_str(format!("Count is {:?}\n", result));
88+
io::stdout().write_str(format!("Test took {:?} seconds\n", elapsed));
8989
let thruput = ((size / workers * workers) as float) / (elapsed as float);
90-
io::stdout().write_str(fmt!("Throughput=%f per sec\n", thruput));
90+
io::stdout().write_str(format!("Throughput={} per sec\n", thruput));
9191
assert_eq!(result, num_bytes * size);
9292
}
9393

@@ -101,6 +101,6 @@ fn main() {
101101
args.clone()
102102
};
103103

104-
info!("%?", args);
104+
info2!("{:?}", args);
105105
run(args);
106106
}

branches/try/src/test/bench/shootout-chameneos-redux.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fn show_digit(nn: uint) -> ~str {
6666
7 => {~"seven"}
6767
8 => {~"eight"}
6868
9 => {~"nine"}
69-
_ => {fail!("expected digits from 0 to 9...")}
69+
_ => {fail2!("expected digits from 0 to 9...")}
7070
}
7171
}
7272

@@ -129,8 +129,8 @@ fn creature(
129129
}
130130
option::None => {
131131
// log creatures met and evil clones of self
132-
let report = fmt!("%u %s",
133-
creatures_met, show_number(evil_clones_met));
132+
let report = format!("{} {}",
133+
creatures_met, show_number(evil_clones_met));
134134
to_rendezvous_log.send(report);
135135
break;
136136
}

branches/try/src/test/bench/shootout-k-nucleotide-pipes.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ fn sort_and_fmt(mm: &HashMap<~[u8], uint>, total: uint) -> ~str {
7575
let b = str::raw::from_utf8(k);
7676
// FIXME: #4318 Instead of to_ascii and to_str_ascii, could use
7777
// to_ascii_move and to_str_move to not do a unnecessary copy.
78-
buffer.push_str(fmt!("%s %0.3f\n", b.to_ascii().to_upper().to_str_ascii(), v));
78+
buffer.push_str(format!("{} {:0.3f}\n",
79+
b.to_ascii().to_upper().to_str_ascii(), v));
7980
}
8081
}
8182

@@ -142,11 +143,11 @@ fn make_sequence_processor(sz: uint,
142143
let buffer = match sz {
143144
1u => { sort_and_fmt(&freqs, total) }
144145
2u => { sort_and_fmt(&freqs, total) }
145-
3u => { fmt!("%u\t%s", find(&freqs, ~"GGT"), "GGT") }
146-
4u => { fmt!("%u\t%s", find(&freqs, ~"GGTA"), "GGTA") }
147-
6u => { fmt!("%u\t%s", find(&freqs, ~"GGTATT"), "GGTATT") }
148-
12u => { fmt!("%u\t%s", find(&freqs, ~"GGTATTTTAATT"), "GGTATTTTAATT") }
149-
18u => { fmt!("%u\t%s", find(&freqs, ~"GGTATTTTAATTTATAGT"), "GGTATTTTAATTTATAGT") }
146+
3u => { format!("{}\t{}", find(&freqs, ~"GGT"), "GGT") }
147+
4u => { format!("{}\t{}", find(&freqs, ~"GGTA"), "GGTA") }
148+
6u => { format!("{}\t{}", find(&freqs, ~"GGTATT"), "GGTATT") }
149+
12u => { format!("{}\t{}", find(&freqs, ~"GGTATTTTAATT"), "GGTATTTTAATT") }
150+
18u => { format!("{}\t{}", find(&freqs, ~"GGTATTTTAATTTATAGT"), "GGTATTTTAATTTATAGT") }
150151
_ => { ~"" }
151152
};
152153

branches/try/src/test/bench/shootout-pfib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fn parse_opts(argv: ~[~str]) -> Config {
6666
Ok(ref m) => {
6767
return Config {stress: m.opt_present("stress")}
6868
}
69-
Err(_) => { fail!(); }
69+
Err(_) => { fail2!(); }
7070
}
7171
}
7272

@@ -76,7 +76,7 @@ fn stress_task(id: int) {
7676
let n = 15;
7777
assert_eq!(fib(n), fib(n));
7878
i += 1;
79-
error!("%d: Completed %d iterations", id, i);
79+
error2!("{}: Completed {} iterations", id, i);
8080
}
8181
}
8282

@@ -123,8 +123,8 @@ fn main() {
123123

124124
let elapsed = stop - start;
125125

126-
out.write_line(fmt!("%d\t%d\t%s", n, fibn,
127-
elapsed.to_str()));
126+
out.write_line(format!("{}\t{}\t{}", n, fibn,
127+
elapsed.to_str()));
128128
}
129129
}
130130
}

branches/try/src/test/bench/std-smallintmap.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ fn main() {
5959

6060
let maxf = max as float;
6161

62-
io::stdout().write_str(fmt!("insert(): %? seconds\n", checkf));
63-
io::stdout().write_str(fmt!(" : %f op/sec\n", maxf/checkf));
64-
io::stdout().write_str(fmt!("get() : %? seconds\n", appendf));
65-
io::stdout().write_str(fmt!(" : %f op/sec\n", maxf/appendf));
62+
io::stdout().write_str(format!("insert(): {:?} seconds\n", checkf));
63+
io::stdout().write_str(format!(" : {} op/sec\n", maxf/checkf));
64+
io::stdout().write_str(format!("get() : {:?} seconds\n", appendf));
65+
io::stdout().write_str(format!(" : {} op/sec\n", maxf/appendf));
6666
}

branches/try/src/test/bench/sudoku.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,17 @@ impl Sudoku {
7979
g[row][col] = from_str::<uint>(comps[2]).unwrap() as u8;
8080
}
8181
else {
82-
fail!("Invalid sudoku file");
82+
fail2!("Invalid sudoku file");
8383
}
8484
}
8585
return Sudoku::new(g)
8686
}
8787
8888
pub fn write(&self, writer: @io::Writer) {
8989
for row in range(0u8, 9u8) {
90-
writer.write_str(fmt!("%u", self.grid[row][0] as uint));
90+
writer.write_str(format!("{}", self.grid[row][0] as uint));
9191
for col in range(1u8, 9u8) {
92-
writer.write_str(fmt!(" %u", self.grid[row][col] as uint));
92+
writer.write_str(format!(" {}", self.grid[row][col] as uint));
9393
}
9494
writer.write_char('\n');
9595
}
@@ -117,7 +117,7 @@ impl Sudoku {
117117
ptr = ptr + 1u;
118118
} else {
119119
// no: redo this field aft recoloring pred; unless there is none
120-
if ptr == 0u { fail!("No solution found for this sudoku"); }
120+
if ptr == 0u { fail2!("No solution found for this sudoku"); }
121121
ptr = ptr - 1u;
122122
}
123123
}

branches/try/src/test/bench/task-perf-alloc-unwind.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ fn main() {
3131

3232
fn run(repeat: int, depth: int) {
3333
for _ in range(0, repeat) {
34-
info!("starting %.4f", precise_time_s());
34+
info2!("starting {:.4f}", precise_time_s());
3535
do task::try {
3636
recurse_or_fail(depth, None)
3737
};
38-
info!("stopping %.4f", precise_time_s());
38+
info2!("stopping {:.4f}", precise_time_s());
3939
}
4040
}
4141

@@ -68,8 +68,8 @@ fn r(l: @nillist) -> r {
6868

6969
fn recurse_or_fail(depth: int, st: Option<State>) {
7070
if depth == 0 {
71-
info!("unwinding %.4f", precise_time_s());
72-
fail!();
71+
info2!("unwinding {:.4f}", precise_time_s());
72+
fail2!();
7373
} else {
7474
let depth = depth - 1;
7575

branches/try/src/test/bench/task-perf-jargon-metal-smoke.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ fn main() {
5454
let (p,c) = comm::stream();
5555
child_generation(from_str::<uint>(args[1]).unwrap(), c);
5656
if p.try_recv().is_none() {
57-
fail!("it happened when we slumbered");
57+
fail2!("it happened when we slumbered");
5858
}
5959
}

branches/try/src/test/bench/task-perf-linked-failure.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ fn grandchild_group(num_tasks: uint) {
4343
p.recv(); // block forever
4444
}
4545
}
46-
error!("Grandchild group getting started");
46+
error2!("Grandchild group getting started");
4747
for _ in range(0, num_tasks) {
4848
// Make sure all above children are fully spawned; i.e., enlisted in
4949
// their ancestor groups.
5050
po.recv();
5151
}
52-
error!("Grandchild group ready to go.");
52+
error2!("Grandchild group ready to go.");
5353
// Master grandchild task exits early.
5454
}
5555

@@ -59,7 +59,7 @@ fn spawn_supervised_blocking(myname: &str, f: ~fn()) {
5959
builder.future_result(|r| res = Some(r));
6060
builder.supervised();
6161
builder.spawn(f);
62-
error!("%s group waiting", myname);
62+
error2!("{} group waiting", myname);
6363
let x = res.unwrap().recv();
6464
assert_eq!(x, task::Success);
6565
}
@@ -85,11 +85,11 @@ fn main() {
8585
grandchild_group(num_tasks);
8686
}
8787
// When grandchild group is ready to go, make the middle group exit.
88-
error!("Middle group wakes up and exits");
88+
error2!("Middle group wakes up and exits");
8989
}
9090
// Grandparent group waits for middle group to be gone, then fails
91-
error!("Grandparent group wakes up and fails");
92-
fail!();
91+
error2!("Grandparent group wakes up and fails");
92+
fail2!();
9393
};
9494
assert!(x.is_err());
9595
}

0 commit comments

Comments
 (0)