Skip to content

Commit c7d7302

Browse files
committed
---
yaml --- r: 14672 b: refs/heads/try c: e9b5f42 h: refs/heads/master v: v3
1 parent fdc8c37 commit c7d7302

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 3c0e98444944a05585600e807956778477c546af
5+
refs/heads/try: e9b5f4204a113bcbba4819b2ac728c22df113994
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/libcore/task.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ fn future_task(builder: task_builder) -> future::future<task> {
312312
let po = comm::port();
313313
let ch = comm::chan(po);
314314
add_wrapper(builder) {|body|
315-
fn~[move body]() {
315+
fn~() {
316316
comm::send(ch, get_task());
317317
body();
318318
}
@@ -347,12 +347,12 @@ fn run_listener<A:send>(-builder: task_builder,
347347
let setup_po = comm::port();
348348
let setup_ch = comm::chan(setup_po);
349349

350-
run(builder, fn~[move f]() {
350+
run(builder) {||
351351
let po = comm::port();
352352
let ch = comm::chan(po);
353353
comm::send(setup_ch, ch);
354354
f(po);
355-
});
355+
}
356356

357357
comm::recv(setup_po)
358358
}
@@ -451,9 +451,9 @@ fn try<T:send>(+f: fn~() -> T) -> result::t<T,()> {
451451
let builder = mk_task_builder();
452452
unsupervise(builder);
453453
let result = future_result(builder);
454-
run(builder, fn~[move f]() {
454+
run(builder) {||
455455
comm::send(ch, f());
456-
});
456+
}
457457
alt future::get(result) {
458458
success { result::ok(comm::recv(po)) }
459459
failure { result::err(()) }
@@ -506,7 +506,7 @@ fn spawn_raw(opts: task_opts, +f: fn~()) unsafe {
506506
// was designed to let the child unsupervise itself, when what
507507
// we actually want is for parents to unsupervise new
508508
// children.
509-
fn~[move f]() {
509+
fn~() {
510510
rustrt::unsupervise();
511511
f();
512512
}
@@ -852,10 +852,10 @@ fn avoid_copying_the_body(spawnfn: fn(+fn~())) {
852852
let x = ~1;
853853
let x_in_parent = ptr::addr_of(*x) as uint;
854854

855-
spawnfn(fn~[move x]() {
855+
spawnfn {||
856856
let x_in_child = ptr::addr_of(*x) as uint;
857857
comm::send(ch, x_in_child);
858-
});
858+
}
859859

860860
let x_in_child = comm::recv(p);
861861
assert x_in_parent == x_in_child;
@@ -879,17 +879,17 @@ fn test_avoid_copying_the_body_spawn_listener() {
879879
fn test_avoid_copying_the_body_run() {
880880
avoid_copying_the_body {|f|
881881
let builder = mk_task_builder();
882-
run(builder, fn~[move f]() {
882+
run(builder) {||
883883
f();
884-
});
884+
}
885885
}
886886
}
887887

888888
#[test]
889889
fn test_avoid_copying_the_body_run_listener() {
890890
avoid_copying_the_body {|f|
891891
let builder = mk_task_builder();
892-
run_listener(builder,fn~[move f](_po: comm::port<int>) {
892+
run_listener(builder, fn~[move f](_po: comm::port<int>) {
893893
f();
894894
});
895895
}
@@ -898,9 +898,9 @@ fn test_avoid_copying_the_body_run_listener() {
898898
#[test]
899899
fn test_avoid_copying_the_body_try() {
900900
avoid_copying_the_body {|f|
901-
try(fn~[move f]() {
902-
f();
903-
});
901+
try {||
902+
f()
903+
};
904904
}
905905
}
906906

@@ -909,9 +909,9 @@ fn test_avoid_copying_the_body_future_task() {
909909
avoid_copying_the_body {|f|
910910
let builder = mk_task_builder();
911911
future_task(builder);
912-
run(builder, fn~[move f]() {
912+
run(builder) {||
913913
f();
914-
});
914+
}
915915
}
916916
}
917917

@@ -920,8 +920,8 @@ fn test_avoid_copying_the_body_unsupervise() {
920920
avoid_copying_the_body {|f|
921921
let builder = mk_task_builder();
922922
unsupervise(builder);
923-
run(builder, fn~[move f]() {
923+
run(builder) {||
924924
f();
925-
});
925+
}
926926
}
927927
}

0 commit comments

Comments
 (0)