@@ -312,7 +312,7 @@ fn future_task(builder: task_builder) -> future::future<task> {
312
312
let po = comm:: port ( ) ;
313
313
let ch = comm:: chan ( po) ;
314
314
add_wrapper ( builder) { |body|
315
- fn~[ move body ] ( ) {
315
+ fn ~( ) {
316
316
comm:: send ( ch, get_task ( ) ) ;
317
317
body ( ) ;
318
318
}
@@ -347,12 +347,12 @@ fn run_listener<A:send>(-builder: task_builder,
347
347
let setup_po = comm:: port ( ) ;
348
348
let setup_ch = comm:: chan ( setup_po) ;
349
349
350
- run ( builder, fn~ [ move f ] ( ) {
350
+ run ( builder) { ||
351
351
let po = comm:: port ( ) ;
352
352
let ch = comm:: chan ( po) ;
353
353
comm:: send ( setup_ch, ch) ;
354
354
f ( po) ;
355
- } ) ;
355
+ }
356
356
357
357
comm:: recv ( setup_po)
358
358
}
@@ -451,9 +451,9 @@ fn try<T:send>(+f: fn~() -> T) -> result::t<T,()> {
451
451
let builder = mk_task_builder ( ) ;
452
452
unsupervise ( builder) ;
453
453
let result = future_result ( builder) ;
454
- run ( builder, fn~ [ move f ] ( ) {
454
+ run ( builder) { ||
455
455
comm:: send ( ch, f ( ) ) ;
456
- } ) ;
456
+ }
457
457
alt future:: get ( result) {
458
458
success { result : : ok ( comm:: recv ( po) ) }
459
459
failure { result : : err ( ( ) ) }
@@ -506,7 +506,7 @@ fn spawn_raw(opts: task_opts, +f: fn~()) unsafe {
506
506
// was designed to let the child unsupervise itself, when what
507
507
// we actually want is for parents to unsupervise new
508
508
// children.
509
- fn ~[ move f ] ( ) {
509
+ fn ~( ) {
510
510
rustrt:: unsupervise ( ) ;
511
511
f ( ) ;
512
512
}
@@ -852,10 +852,10 @@ fn avoid_copying_the_body(spawnfn: fn(+fn~())) {
852
852
let x = ~1 ;
853
853
let x_in_parent = ptr:: addr_of ( * x) as uint ;
854
854
855
- spawnfn ( fn~ [ move x ] ( ) {
855
+ spawnfn { ||
856
856
let x_in_child = ptr:: addr_of ( * x) as uint ;
857
857
comm:: send ( ch, x_in_child) ;
858
- } ) ;
858
+ }
859
859
860
860
let x_in_child = comm:: recv ( p) ;
861
861
assert x_in_parent == x_in_child;
@@ -879,17 +879,17 @@ fn test_avoid_copying_the_body_spawn_listener() {
879
879
fn test_avoid_copying_the_body_run ( ) {
880
880
avoid_copying_the_body { |f|
881
881
let builder = mk_task_builder ( ) ;
882
- run ( builder, fn~ [ move f ] ( ) {
882
+ run ( builder) { ||
883
883
f ( ) ;
884
- } ) ;
884
+ }
885
885
}
886
886
}
887
887
888
888
#[ test]
889
889
fn test_avoid_copying_the_body_run_listener ( ) {
890
890
avoid_copying_the_body { |f|
891
891
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>) {
893
893
f ( ) ;
894
894
} ) ;
895
895
}
@@ -898,9 +898,9 @@ fn test_avoid_copying_the_body_run_listener() {
898
898
#[ test]
899
899
fn test_avoid_copying_the_body_try ( ) {
900
900
avoid_copying_the_body { |f|
901
- try( fn~ [ move f ] ( ) {
902
- f ( ) ;
903
- } ) ;
901
+ try { ||
902
+ f ( )
903
+ } ;
904
904
}
905
905
}
906
906
@@ -909,9 +909,9 @@ fn test_avoid_copying_the_body_future_task() {
909
909
avoid_copying_the_body { |f|
910
910
let builder = mk_task_builder ( ) ;
911
911
future_task ( builder) ;
912
- run ( builder, fn~ [ move f ] ( ) {
912
+ run ( builder) { ||
913
913
f ( ) ;
914
- } ) ;
914
+ }
915
915
}
916
916
}
917
917
@@ -920,8 +920,8 @@ fn test_avoid_copying_the_body_unsupervise() {
920
920
avoid_copying_the_body { |f|
921
921
let builder = mk_task_builder ( ) ;
922
922
unsupervise ( builder) ;
923
- run ( builder, fn~ [ move f ] ( ) {
923
+ run ( builder) { ||
924
924
f ( ) ;
925
- } ) ;
925
+ }
926
926
}
927
927
}
0 commit comments