99// except according to those terms.
1010
1111// Tests that a heterogeneous list of existential types can be put inside an ARC
12- // and shared between tasks as long as all types fulfill Const+Owned .
12+ // and shared between tasks as long as all types fulfill Freeze+Send .
1313
1414// xfail-fast
1515
@@ -64,10 +64,10 @@ fn main() {
6464 let dogge1 = Dogge { bark_decibels : 100 , tricks_known : 42 , name : ~"alan_turing" } ;
6565 let dogge2 = Dogge { bark_decibels : 55 , tricks_known : 11 , name : ~"albert_einstein" } ;
6666 let fishe = Goldfyshe { swim_speed : 998 , name : ~"alec_guinness" } ;
67- let arc = arc:: ARC ( ~[ ~catte as ~Pet : Const + Owned ,
68- ~dogge1 as ~Pet : Const + Owned ,
69- ~fishe as ~Pet : Const + Owned ,
70- ~dogge2 as ~Pet : Const + Owned ] ) ;
67+ let arc = arc:: ARC ( ~[ ~catte as ~Pet : Freeze + Send ,
68+ ~dogge1 as ~Pet : Freeze + Send ,
69+ ~fishe as ~Pet : Freeze + Send ,
70+ ~dogge2 as ~Pet : Freeze + Send ] ) ;
7171 let ( p1, c1) = comm:: stream ( ) ;
7272 let arc1 = cell:: Cell :: new ( arc. clone ( ) ) ;
7373 do task:: spawn { check_legs( arc1. take ( ) ) ; c1. send ( ( ) ) ; }
@@ -82,21 +82,21 @@ fn main() {
8282 p3. recv ( ) ;
8383}
8484
85- fn check_legs ( arc : arc:: ARC < ~[ ~Pet : Const + Owned ] > ) {
85+ fn check_legs ( arc : arc:: ARC < ~[ ~Pet : Freeze + Send ] > ) {
8686 let mut legs = 0 ;
8787 for arc. get( ) . iter( ) . advance |pet| {
8888 legs += pet. num_legs( ) ;
8989 }
9090 assert ! ( legs == 12 ) ;
9191}
92- fn check_names ( arc : arc:: ARC < ~[ ~Pet : Const + Owned ] > ) {
92+ fn check_names ( arc : arc:: ARC < ~[ ~Pet : Freeze + Send ] > ) {
9393 for arc. get( ) . iter( ) . advance |pet| {
9494 do pet. name |name| {
9595 assert ! ( name[ 0 ] == 'a' as u8 && name[ 1 ] == 'l' as u8 ) ;
9696 }
9797 }
9898}
99- fn check_pedigree( arc : arc:: ARC < ~[ ~Pet : Const + Owned ] > ) {
99+ fn check_pedigree( arc : arc:: ARC < ~[ ~Pet : Freeze + Send ] > ) {
100100 for arc. get( ) . iter( ) . advance |pet| {
101101 assert ! ( pet. of_good_pedigree( ) ) ;
102102 }
0 commit comments