@@ -46,8 +46,12 @@ type ast_fold[ENV] =
46
46
( fn ( & ENV e, & span sp,
47
47
vec[ tup ( bool, @ty) ] elts) -> @ty) fold_ty_tup,
48
48
49
+ ( fn ( & ENV e, & span sp,
50
+ vec[ rec ( ast. mode mode, @ty ty) ] inputs,
51
+ @ty output) -> @ty) fold_ty_fn,
52
+
49
53
( fn ( & ENV e, & span sp, ast. path p,
50
- & option. t [ def] d) -> @ty) fold_ty_path,
54
+ & option. t [ def] d) -> @ty) fold_ty_path,
51
55
52
56
// Expr folds.
53
57
( fn( & ENV e, & span sp,
@@ -226,6 +230,10 @@ fn fold_ty[ENV](&ENV env, ast_fold[ENV] fld, @ty t) -> @ty {
226
230
}
227
231
ret fld. fold_ty_path ( env_, t. span , path, ref_opt) ;
228
232
}
233
+
234
+ case ( ast. ty_fn ( ?inputs, ?output) ) {
235
+ ret fld. fold_ty_fn ( env_, t. span , inputs, output) ;
236
+ }
229
237
}
230
238
}
231
239
@@ -567,6 +575,12 @@ fn identity_fold_ty_tup[ENV](&ENV env, &span sp, vec[tup(bool,@ty)] elts)
567
575
ret @respan ( sp, ast. ty_tup ( elts) ) ;
568
576
}
569
577
578
+ fn identity_fold_ty_fn[ ENV ] ( & ENV env, & span sp,
579
+ vec[ rec ( ast. mode mode, @ty ty) ] inputs,
580
+ @ty output) -> @ty {
581
+ ret @respan ( sp, ast. ty_fn ( inputs, output) ) ;
582
+ }
583
+
570
584
fn identity_fold_ty_path[ ENV ] ( & ENV env, & span sp, ast. path p,
571
585
& option. t [ def] d) -> @ty {
572
586
ret @respan ( sp, ast. ty_path ( p, d) ) ;
@@ -785,6 +799,7 @@ fn new_identity_fold[ENV]() -> ast_fold[ENV] {
785
799
fold_ty_box = bind identity_fold_ty_box[ ENV ] ( _, _, _) ,
786
800
fold_ty_vec = bind identity_fold_ty_vec[ ENV ] ( _, _, _) ,
787
801
fold_ty_tup = bind identity_fold_ty_tup[ ENV ] ( _, _, _) ,
802
+ fold_ty_fn = bind identity_fold_ty_fn[ ENV ] ( _, _, _, _) ,
788
803
fold_ty_path = bind identity_fold_ty_path[ ENV ] ( _, _, _, _) ,
789
804
790
805
fold_expr_vec = bind identity_fold_expr_vec[ ENV ] ( _, _, _, _) ,
0 commit comments