@@ -335,9 +335,10 @@ fn ast_ty_to_ty(&ty::ctxt tcx, &ty_getter getter, &@ast::ty ast_ty) -> ty::t {
335
335
}
336
336
auto out_ty = ast_ty_to_ty( tcx, getter, output) ;
337
337
338
- let fn ( & @ast:: constr) -> @ty:: constr_def g =
339
- bind ast_constr_to_constr( tcx, _) ;
340
- let vec[ @ty:: constr_def] out_constrs = vec:: map( g, constrs) ;
338
+ auto out_constrs = ~[ ] ;
339
+ for ( @ast:: constr constr in constrs) {
340
+ out_constrs += ~[ ast_constr_to_constr( tcx, constr) ] ;
341
+ }
341
342
typ = ty:: mk_fn( tcx, proto, i, out_ty, cf, out_constrs) ;
342
343
}
343
344
case ( ast:: ty_path( ?path, ?id) ) {
@@ -371,10 +372,10 @@ fn ast_ty_to_ty(&ty::ctxt tcx, &ty_getter getter, &@ast::ty ast_ty) -> ty::t {
371
372
}
372
373
auto out = ast_ty_to_ty( tcx, getter, m. node. output) ;
373
374
374
- let fn ( & @ast :: constr ) -> @ty :: constr_def g =
375
- bind ast_constr_to_constr ( tcx , _ ) ;
376
- let vec [ @ty :: constr_def ] out_constrs =
377
- vec :: map ( g , m . node . constrs ) ;
375
+ auto out_constrs = ~ [ ] ;
376
+ for ( @ast :: constr constr in m . node . constrs ) {
377
+ out_constrs += ~ [ ast_constr_to_constr ( tcx , constr ) ] ;
378
+ }
378
379
let ty:: method new_m =
379
380
rec( proto=m. node. proto,
380
381
ident=m. node. ident,
@@ -490,9 +491,10 @@ mod collect {
490
491
for ( ast:: arg a in decl. inputs) { input_tys += ~[ ty_of_arg ( a) ] ; }
491
492
auto output_ty = convert ( decl. output ) ;
492
493
493
- let fn( & @ast:: constr) -> @ty:: constr_def g =
494
- bind ast_constr_to_constr ( cx. tcx , _) ;
495
- let vec[ @ty:: constr_def] out_constrs = vec:: map ( g, decl. constraints ) ;
494
+ auto out_constrs = ~[ ] ;
495
+ for ( @ast:: constr constr in decl. constraints) {
496
+ out_constrs += ~[ ast_constr_to_constr ( cx. tcx , constr) ] ;
497
+ }
496
498
auto t_fn =
497
499
ty:: mk_fn ( cx. tcx , proto, input_tys, output_ty, decl. cf ,
498
500
out_constrs) ;
@@ -568,10 +570,11 @@ mod collect {
568
570
}
569
571
570
572
auto output = convert ( m. node . meth . decl . output ) ;
571
- let fn( & @ast:: constr) -> @ty:: constr_def g =
572
- bind ast_constr_to_constr ( cx. tcx , _) ;
573
- let vec[ @ty:: constr_def] out_constrs =
574
- vec:: map ( g, m. node . meth . decl . constraints ) ;
573
+
574
+ auto out_constrs = ~[ ] ;
575
+ for ( @ast:: constr constr in m. node. meth. decl. constraints) {
576
+ out_constrs += ~[ ast_constr_to_constr ( cx. tcx , constr) ] ;
577
+ }
575
578
ret rec( proto=m. node . meth . proto , ident=m. node . ident ,
576
579
inputs=inputs, output=output, cf=m. node . meth . decl . cf ,
577
580
constrs=out_constrs) ;
@@ -596,7 +599,7 @@ mod collect {
596
599
}
597
600
598
601
auto t_fn = ty:: mk_fn( cx. tcx, ast:: proto_fn, t_inputs, t_obj. _1,
599
- ast:: return, [ ] ) ;
602
+ ast:: return, ~ [ ] ) ;
600
603
auto tpt = tup( t_obj. _0, t_fn) ;
601
604
cx. tcx. tcache. insert( local_def( ctor_id) , tpt) ;
602
605
ret tpt;
@@ -707,7 +710,7 @@ mod collect {
707
710
auto tag_t = ty:: mk_tag( cx. tcx, tag_id, ty_param_tys) ;
708
711
// FIXME: this will be different for constrained types
709
712
result_ty = ty:: mk_fn( cx. tcx, ast:: proto_fn, args, tag_t,
710
- ast:: return, [ ] ) ;
713
+ ast:: return, ~ [ ] ) ;
711
714
}
712
715
auto tpt = tup( ty_param_count, result_ty) ;
713
716
cx. tcx. tcache. insert( local_def( variant. node. id) , tpt) ;
@@ -778,7 +781,7 @@ mod collect {
778
781
case ( none) { /* nothing to do * / }
779
782
case ( some( ?m) ) {
780
783
auto t = ty:: mk_fn( cx. tcx, ast:: proto_fn, ~[ ] ,
781
- ty:: mk_nil( cx. tcx) , ast:: return , [ ] ) ;
784
+ ty:: mk_nil( cx. tcx) , ast:: return , ~ [ ] ) ;
782
785
write:: ty_only( cx. tcx, m. node. id, t) ;
783
786
}
784
787
}
@@ -788,9 +791,9 @@ mod collect {
788
791
auto t_res = ty:: mk_res( cx. tcx, local_def( it. id) , t_arg. ty,
789
792
mk_ty_params( cx, vec:: len( tps) ) ) ;
790
793
auto t_ctor = ty:: mk_fn( cx. tcx, ast:: proto_fn, ~[ t_arg] ,
791
- t_res, ast:: return , [ ] ) ;
794
+ t_res, ast:: return , ~ [ ] ) ;
792
795
auto t_dtor = ty:: mk_fn( cx. tcx, ast:: proto_fn, ~[ t_arg] ,
793
- ty:: mk_nil( cx. tcx) , ast:: return , [ ] ) ;
796
+ ty:: mk_nil( cx. tcx) , ast:: return , ~ [ ] ) ;
794
797
write:: ty_only( cx. tcx, it. id, t_res) ;
795
798
write:: ty_only( cx. tcx, ctor_id, t_ctor) ;
796
799
cx. tcx. tcache. insert( local_def( ctor_id) ,
@@ -2254,10 +2257,12 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
2254
2257
}
2255
2258
2256
2259
auto output = convert ( m. node . meth . decl . output ) ;
2257
- let fn( & @ast:: constr) -> @ty:: constr_def g =
2258
- bind ast_constr_to_constr ( ccx. tcx , _) ;
2259
- let vec[ @ty:: constr_def] out_constrs =
2260
- vec:: map ( g, m. node . meth . decl . constraints ) ;
2260
+
2261
+ auto out_constrs = ~[ ] ;
2262
+ for ( @ast:: constr constr in m. node. meth. decl. constraints) {
2263
+ out_constrs += ~[ ast_constr_to_constr ( ccx. tcx , constr) ] ;
2264
+ }
2265
+
2261
2266
ret rec( proto=m. node . meth . proto , ident=m. node . ident ,
2262
2267
inputs=inputs, output=output, cf=m. node . meth . decl . cf ,
2263
2268
constrs=out_constrs) ;
0 commit comments