@@ -337,9 +337,10 @@ fn ast_ty_to_ty(&ty::ctxt tcx, &ty_getter getter, &@ast::ty ast_ty) -> ty::t {
337
337
}
338
338
auto out_ty = ast_ty_to_ty( tcx, getter, output) ;
339
339
340
- let fn ( & @ast:: constr) -> @ty:: constr_def g =
341
- bind ast_constr_to_constr( tcx, _) ;
342
- let vec[ @ty:: constr_def] out_constrs = vec:: map( g, constrs) ;
340
+ auto out_constrs = ~[ ] ;
341
+ for ( @ast:: constr constr in constrs) {
342
+ out_constrs += ~[ ast_constr_to_constr( tcx, constr) ] ;
343
+ }
343
344
typ = ty:: mk_fn( tcx, proto, i, out_ty, cf, out_constrs) ;
344
345
}
345
346
case ( ast:: ty_path( ?path, ?id) ) {
@@ -373,10 +374,10 @@ fn ast_ty_to_ty(&ty::ctxt tcx, &ty_getter getter, &@ast::ty ast_ty) -> ty::t {
373
374
}
374
375
auto out = ast_ty_to_ty( tcx, getter, m. node. output) ;
375
376
376
- let fn ( & @ast :: constr ) -> @ty :: constr_def g =
377
- bind ast_constr_to_constr ( tcx , _ ) ;
378
- let vec [ @ty :: constr_def ] out_constrs =
379
- vec :: map ( g , m . node . constrs ) ;
377
+ auto out_constrs = ~ [ ] ;
378
+ for ( @ast :: constr constr in m . node . constrs ) {
379
+ out_constrs += ~ [ ast_constr_to_constr ( tcx , constr ) ] ;
380
+ }
380
381
let ty:: method new_m =
381
382
rec( proto=m. node. proto,
382
383
ident=m. node. ident,
@@ -492,9 +493,10 @@ mod collect {
492
493
for ( ast:: arg a in decl. inputs) { input_tys += ~[ ty_of_arg ( a) ] ; }
493
494
auto output_ty = convert ( decl. output ) ;
494
495
495
- let fn( & @ast:: constr) -> @ty:: constr_def g =
496
- bind ast_constr_to_constr ( cx. tcx , _) ;
497
- let vec[ @ty:: constr_def] out_constrs = vec:: map ( g, decl. constraints ) ;
496
+ auto out_constrs = ~[ ] ;
497
+ for ( @ast:: constr constr in decl. constraints) {
498
+ out_constrs += ~[ ast_constr_to_constr ( cx. tcx , constr) ] ;
499
+ }
498
500
auto t_fn =
499
501
ty:: mk_fn ( cx. tcx , proto, input_tys, output_ty, decl. cf ,
500
502
out_constrs) ;
@@ -570,10 +572,11 @@ mod collect {
570
572
}
571
573
572
574
auto output = convert ( m. node . meth . decl . output ) ;
573
- let fn( & @ast:: constr) -> @ty:: constr_def g =
574
- bind ast_constr_to_constr ( cx. tcx , _) ;
575
- let vec[ @ty:: constr_def] out_constrs =
576
- vec:: map ( g, m. node . meth . decl . constraints ) ;
575
+
576
+ auto out_constrs = ~[ ] ;
577
+ for ( @ast:: constr constr in m. node. meth. decl. constraints) {
578
+ out_constrs += ~[ ast_constr_to_constr ( cx. tcx , constr) ] ;
579
+ }
577
580
ret rec( proto=m. node . meth . proto , ident=m. node . ident ,
578
581
inputs=inputs, output=output, cf=m. node . meth . decl . cf ,
579
582
constrs=out_constrs) ;
@@ -598,7 +601,7 @@ mod collect {
598
601
}
599
602
600
603
auto t_fn = ty:: mk_fn( cx. tcx, ast:: proto_fn, t_inputs, t_obj. _1,
601
- ast:: return, [ ] ) ;
604
+ ast:: return, ~ [ ] ) ;
602
605
auto tpt = tup( t_obj. _0, t_fn) ;
603
606
cx. tcx. tcache. insert( local_def( ctor_id) , tpt) ;
604
607
ret tpt;
@@ -709,7 +712,7 @@ mod collect {
709
712
auto tag_t = ty:: mk_tag( cx. tcx, tag_id, ty_param_tys) ;
710
713
// FIXME: this will be different for constrained types
711
714
result_ty = ty:: mk_fn( cx. tcx, ast:: proto_fn, args, tag_t,
712
- ast:: return, [ ] ) ;
715
+ ast:: return, ~ [ ] ) ;
713
716
}
714
717
auto tpt = tup( ty_param_count, result_ty) ;
715
718
cx. tcx. tcache. insert( local_def( variant. node. id) , tpt) ;
@@ -780,7 +783,7 @@ mod collect {
780
783
case ( none) { /* nothing to do * / }
781
784
case ( some( ?m) ) {
782
785
auto t = ty:: mk_fn( cx. tcx, ast:: proto_fn, ~[ ] ,
783
- ty:: mk_nil( cx. tcx) , ast:: return , [ ] ) ;
786
+ ty:: mk_nil( cx. tcx) , ast:: return , ~ [ ] ) ;
784
787
write:: ty_only( cx. tcx, m. node. id, t) ;
785
788
}
786
789
}
@@ -790,9 +793,9 @@ mod collect {
790
793
auto t_res = ty:: mk_res( cx. tcx, local_def( it. id) , t_arg. ty,
791
794
mk_ty_params( cx, vec:: len( tps) ) ) ;
792
795
auto t_ctor = ty:: mk_fn( cx. tcx, ast:: proto_fn, ~[ t_arg] ,
793
- t_res, ast:: return , [ ] ) ;
796
+ t_res, ast:: return , ~ [ ] ) ;
794
797
auto t_dtor = ty:: mk_fn( cx. tcx, ast:: proto_fn, ~[ t_arg] ,
795
- ty:: mk_nil( cx. tcx) , ast:: return , [ ] ) ;
798
+ ty:: mk_nil( cx. tcx) , ast:: return , ~ [ ] ) ;
796
799
write:: ty_only( cx. tcx, it. id, t_res) ;
797
800
write:: ty_only( cx. tcx, ctor_id, t_ctor) ;
798
801
cx. tcx. tcache. insert( local_def( ctor_id) ,
@@ -2285,10 +2288,12 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
2285
2288
}
2286
2289
2287
2290
auto output = convert ( m. node . meth . decl . output ) ;
2288
- let fn( & @ast:: constr) -> @ty:: constr_def g =
2289
- bind ast_constr_to_constr ( ccx. tcx , _) ;
2290
- let vec[ @ty:: constr_def] out_constrs =
2291
- vec:: map ( g, m. node . meth . decl . constraints ) ;
2291
+
2292
+ auto out_constrs = ~[ ] ;
2293
+ for ( @ast:: constr constr in m. node. meth. decl. constraints) {
2294
+ out_constrs += ~[ ast_constr_to_constr ( ccx. tcx , constr) ] ;
2295
+ }
2296
+
2292
2297
ret rec( proto=m. node . meth . proto , ident=m. node . ident ,
2293
2298
inputs=inputs, output=output, cf=m. node . meth . decl . cf ,
2294
2299
constrs=out_constrs) ;
0 commit comments