Skip to content

Commit 4bdcacc

Browse files
committed
---
yaml --- r: 24541 b: refs/heads/try2 c: 41bca84 h: refs/heads/master i: 24539: 5cc3b4c v: v3
1 parent b4bd0a7 commit 4bdcacc

File tree

15 files changed

+35
-35
lines changed

15 files changed

+35
-35
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: ae6ea068a12877742247b848ceeaa39c41e981c6
8+
refs/heads/try2: 41bca84dd95e0ef9ceb9f0a304eca0d62602198b
99
refs/heads/incoming: 05543fd04dfb3f63b453a331e239ceb1a9a219f9
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try2/src/libcore/comm.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -364,16 +364,16 @@ fn test_select2_rendezvous() {
364364
let ch_a = chan(po_a);
365365
let ch_b = chan(po_b);
366366

367-
do iter::repeat(10u) || {
367+
for iter::repeat(10u) || {
368368
do task::spawn || {
369-
iter::repeat(10u, || task::yield());
369+
for iter::repeat(10u) { task::yield() }
370370
send(ch_a, "a");
371371
};
372372

373373
assert select2(po_a, po_b) == either::left("a");
374374

375375
do task::spawn || {
376-
iter::repeat(10u, || task::yield());
376+
for iter::repeat(10u) { task::yield() }
377377
send(ch_b, "b");
378378
};
379379

@@ -391,22 +391,22 @@ fn test_select2_stress() {
391391
let msgs = 100u;
392392
let times = 4u;
393393

394-
do iter::repeat(times) || {
394+
for iter::repeat(times) || {
395395
do task::spawn || {
396-
do iter::repeat(msgs) || {
396+
for iter::repeat(msgs) || {
397397
send(ch_a, "a")
398398
}
399399
};
400400
do task::spawn || {
401-
do iter::repeat(msgs) || {
401+
for iter::repeat(msgs) || {
402402
send(ch_b, "b")
403403
}
404404
};
405405
}
406406

407407
let mut as = 0;
408408
let mut bs = 0;
409-
do iter::repeat(msgs * times * 2u) || {
409+
for iter::repeat(msgs * times * 2u) || {
410410
alt check select2(po_a, po_b) {
411411
either::left("a") { as += 1 }
412412
either::right("b") { bs += 1 }
@@ -473,7 +473,7 @@ fn test_listen() {
473473
#[test]
474474
#[ignore(cfg(windows))]
475475
fn test_port_detach_fail() {
476-
do iter::repeat(100u) || {
476+
for iter::repeat(100u) || {
477477
let builder = task::builder();
478478
task::unsupervise(builder);
479479
do task::run(builder) || {

branches/try2/src/libcore/iter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ fn position<A,IA:base_iter<A>>(self: IA, f: fn(A) -> bool)
9999
// iter interface, such as would provide "reach" in addition to "each". as is,
100100
// it would have to be implemented with foldr, which is too inefficient.
101101

102-
fn repeat(times: uint, blk: fn()) {
102+
fn repeat(times: uint, blk: fn() -> bool) {
103103
let mut i = 0u;
104104
while i < times {
105-
blk();
105+
if !blk() { break }
106106
i += 1u;
107107
}
108108
}

branches/try2/src/libcore/priv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ fn test_from_global_chan1() {
121121
#[test]
122122
fn test_from_global_chan2() {
123123

124-
do iter::repeat(100u) || {
124+
for iter::repeat(100u) || {
125125
// The global channel
126126
let globchan = 0u;
127127
let globchanp = ptr::addr_of(globchan);
@@ -224,7 +224,7 @@ fn test_weaken_task_wait() {
224224
#[test]
225225
fn test_weaken_task_stress() {
226226
// Create a bunch of weak tasks
227-
do iter::repeat(100u) || {
227+
for iter::repeat(100u) || {
228228
do task::spawn || {
229229
unsafe {
230230
do weaken_task |_po| {

branches/try2/src/libcore/task.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@ fn test_spawn_sched_blocking() {
10031003

10041004
// Testing that a task in one scheduler can block in foreign code
10051005
// without affecting other schedulers
1006-
do iter::repeat(20u) || {
1006+
for iter::repeat(20u) || {
10071007

10081008
let start_po = comm::port();
10091009
let start_ch = comm::chan(start_po);
@@ -1168,7 +1168,7 @@ fn test_unkillable() {
11681168

11691169
// We want to do this after failing
11701170
do spawn || {
1171-
iter::repeat(10u, yield);
1171+
for iter::repeat(10u) { yield() }
11721172
ch.send(());
11731173
}
11741174

branches/try2/src/libstd/timer.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ mod test {
151151
#[test]
152152
fn test_gl_timer_sleep_stress1() {
153153
let hl_loop = uv::global_loop::get();
154-
do iter::repeat(200u) || {
154+
for iter::repeat(200u) || {
155155
sleep(hl_loop, 1u);
156156
}
157157
}
@@ -171,22 +171,22 @@ mod test {
171171

172172
};
173173

174-
do iter::repeat(repeat) || {
174+
for iter::repeat(repeat) || {
175175

176176
for spec.each |spec| {
177177
let (times, maxms) = spec;
178178
do task::spawn || {
179179
import rand::*;
180180
let rng = rng();
181-
do iter::repeat(times) || {
181+
for iter::repeat(times) || {
182182
sleep(hl_loop, rng.next() as uint % maxms);
183183
}
184184
comm::send(ch, ());
185185
}
186186
}
187187
}
188188

189-
do iter::repeat(repeat * spec.len()) || {
189+
for iter::repeat(repeat * spec.len()) || {
190190
comm::recv(po)
191191
}
192192
}
@@ -204,7 +204,7 @@ mod test {
204204
let mut failures = 0;
205205
let hl_loop = uv::global_loop::get();
206206

207-
do iter::repeat(times as uint) || {
207+
for iter::repeat(times as uint) || {
208208
task::yield();
209209

210210
let expected = rand::rng().gen_str(16u);
@@ -231,7 +231,7 @@ mod test {
231231
let mut failures = 0;
232232
let hl_loop = uv::global_loop::get();
233233

234-
do iter::repeat(times as uint) || {
234+
for iter::repeat(times as uint) || {
235235
let expected = rand::rng().gen_str(16u);
236236
let test_po = comm::port::<str>();
237237
let test_ch = comm::chan(test_po);

branches/try2/src/libstd/uv_global_loop.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,13 @@ mod test {
191191
let exit_po = comm::port::<()>();
192192
let exit_ch = comm::chan(exit_po);
193193
let cycles = 5000u;
194-
do iter::repeat(cycles) || {
194+
for iter::repeat(cycles) || {
195195
task::spawn_sched(task::manual_threads(1u), || {
196196
impl_uv_hl_simple_timer(hl_loop);
197197
comm::send(exit_ch, ());
198198
});
199199
};
200-
do iter::repeat(cycles) || {
200+
for iter::repeat(cycles) || {
201201
comm::recv(exit_po);
202202
};
203203
log(debug, "test_stress_gl_uv_global_loop_high_level_global_timer"+

branches/try2/src/libstd/uv_iotask.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,13 +255,13 @@ mod test {
255255
// called, at least.
256256
let work_exit_po = comm::port::<()>();
257257
let work_exit_ch = comm::chan(work_exit_po);
258-
do iter::repeat(7u) || {
258+
for iter::repeat(7u) || {
259259
do task::spawn_sched(task::manual_threads(1u)) || {
260260
impl_uv_iotask_async(iotask);
261261
comm::send(work_exit_ch, ());
262262
};
263263
};
264-
do iter::repeat(7u) || {
264+
for iter::repeat(7u) || {
265265
comm::recv(work_exit_po);
266266
};
267267
log(debug, "sending teardown_loop msg..");

branches/try2/src/rustdoc/markdown_pass.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ fn should_request_new_writer_for_each_page() {
115115
let doc = page_pass::mk_pass(config::doc_per_mod).f(srv, doc);
116116
write_markdown(doc, writer_factory);
117117
// We expect two pages to have been written
118-
do iter::repeat(2u) || {
118+
for iter::repeat(2u) || {
119119
comm::recv(po);
120120
}
121121
}
@@ -146,7 +146,7 @@ fn should_write_title_for_each_page() {
146146
"#[link(name = \"core\")]; mod a { }");
147147
let doc = page_pass::mk_pass(config::doc_per_mod).f(srv, doc);
148148
write_markdown(doc, writer_factory);
149-
do iter::repeat(2u) || {
149+
for iter::repeat(2u) || {
150150
let (page, markdown) = comm::recv(po);
151151
alt page {
152152
doc::cratepage(_) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fn main() {
1717
}
1818

1919
fn run(repeat: int, depth: int) {
20-
do iter::repeat(repeat as uint) || {
20+
for iter::repeat(repeat as uint) || {
2121
#debug("starting %.4f", precise_time_s());
2222
do task::try || {
2323
recurse_or_fail(depth, none)

branches/try2/src/test/bench/task-perf-one-million.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ fn calc(children: uint, parent_ch: comm::chan<msg>) {
1212
let mut child_chs = ~[];
1313
let mut sum = 0;
1414

15-
do iter::repeat (children) || {
15+
for iter::repeat (children) || {
1616
do task::spawn || {
1717
calc(0u, chan);
1818
};
1919
}
2020

21-
do iter::repeat (children) || {
21+
for iter::repeat (children) || {
2222
alt check comm::recv(port) {
2323
ready(child_ch) {
2424
vec::push(child_chs, child_ch);
@@ -36,7 +36,7 @@ fn calc(children: uint, parent_ch: comm::chan<msg>) {
3636
}
3737
}
3838

39-
do iter::repeat (children) || {
39+
for iter::repeat (children) || {
4040
alt check comm::recv(port) {
4141
done(child_sum) { sum += child_sum; }
4242
}

branches/try2/src/test/run-fail/extern-fail.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn count(n: uint) -> uint {
2121
}
2222

2323
fn main() {
24-
do iter::repeat(10u) || {
24+
for iter::repeat(10u) || {
2525
do task::spawn || {
2626
let result = count(5u);
2727
#debug("result = %?", result);

branches/try2/src/test/run-pass/extern-stress.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn count(n: uint) -> uint {
2020
}
2121

2222
fn main() {
23-
do iter::repeat(100u) || {
23+
for iter::repeat(100u) || {
2424
do task::spawn || {
2525
assert count(5u) == 16u;
2626
};

branches/try2/src/test/run-pass/extern-yield.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fn count(n: uint) -> uint {
1717
}
1818

1919
fn main() {
20-
do iter::repeat(10u) || {
20+
for iter::repeat(10u) || {
2121
do task::spawn || {
2222
let result = count(5u);
2323
#debug("result = %?", result);

branches/try2/src/test/run-pass/issue-783.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn a() {
2121
}
2222

2323
fn main() {
24-
do iter::repeat(100u) || {
24+
for iter::repeat(100u) || {
2525
spawn(|| a() );
2626
}
2727
}

0 commit comments

Comments
 (0)