@@ -1163,7 +1163,7 @@ type gather_result =
1163
1163
hashmap[ ast:: node_id, ast:: ident] local_names,
1164
1164
int next_var_id) ;
1165
1165
1166
- fn gather_locals( & @crate_ctxt ccx, & ast:: fn_decl decl , & ast :: block body ,
1166
+ fn gather_locals( & @crate_ctxt ccx, & ast:: _fn f ,
1167
1167
& ast:: node_id id) -> gather_result {
1168
1168
fn next_var_id( @mutable int nvi) -> int {
1169
1169
auto rv = * nvi;
@@ -1207,8 +1207,8 @@ fn gather_locals(&@crate_ctxt ccx, &ast::fn_decl decl, &ast::block body,
1207
1207
auto args = ty:: ty_fn_args( ccx. tcx, ty:: node_id_to_type( ccx. tcx, id) ) ;
1208
1208
auto i = 0 u;
1209
1209
for ( ty:: arg arg in args) {
1210
- assign( ccx. tcx, vb, locals, local_names, nvi, decl. inputs. ( i) . id,
1211
- decl. inputs. ( i) . ident, some[ ty:: t] ( arg. ty) ) ;
1210
+ assign( ccx. tcx, vb, locals, local_names, nvi, f . decl. inputs. ( i) . id,
1211
+ f . decl. inputs. ( i) . ident, some[ ty:: t] ( arg. ty) ) ;
1212
1212
i += 1 u;
1213
1213
}
1214
1214
// Add explicitly-declared locals.
@@ -1253,7 +1253,7 @@ fn gather_locals(&@crate_ctxt ccx, &ast::fn_decl decl, &ast::block body,
1253
1253
visit_pat_pre=bind visit_pat_pre( ccx, vb, locals, local_names,
1254
1254
nvi, _)
1255
1255
with walk:: default_visitor( ) ) ;
1256
- walk:: walk_block( visit, body) ;
1256
+ walk:: walk_block( visit, f . body) ;
1257
1257
ret rec( var_bindings=vb,
1258
1258
locals=locals,
1259
1259
local_names=local_names,
@@ -1999,7 +1999,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
1999
1999
collect:: ty_of_fn_decl( cx, convert, ty_of_arg, f. decl,
2000
2000
f. proto, ~[ ] , none) . _1;
2001
2001
write:: ty_only_fixup( fcx, id, fty) ;
2002
- check_fn( fcx. ccx, f. decl , f . proto , f . body , id) ;
2002
+ check_fn( fcx. ccx, f, id) ;
2003
2003
}
2004
2004
case ( ast:: expr_block( ?b) ) {
2005
2005
check_block( fcx, b) ;
@@ -2577,9 +2577,10 @@ fn check_const(&@crate_ctxt ccx, &span sp, &@ast::expr e, &ast::node_id id) {
2577
2577
check_expr ( fcx, e) ;
2578
2578
}
2579
2579
2580
- fn check_fn ( & @crate_ctxt ccx , & ast:: fn_decl decl, ast:: proto proto,
2581
- & ast:: block body, & ast:: node_id id) {
2582
- auto gather_result = gather_locals ( ccx, decl, body, id) ;
2580
+ fn check_fn ( & @crate_ctxt ccx , & ast:: _fn f, & ast:: node_id id) {
2581
+ auto decl = f. decl ;
2582
+ auto body = f. body ;
2583
+ auto gather_result = gather_locals ( ccx, f, id) ;
2583
2584
let ast:: node_id[ ] fixups = ~[ ] ;
2584
2585
let @fn_ctxt fcx =
2585
2586
@rec ( ret_ty=ast_ty_to_ty_crate ( ccx, decl. output ) ,
@@ -2621,8 +2622,7 @@ fn check_fn(&@crate_ctxt ccx, &ast::fn_decl decl, ast::proto proto,
2621
2622
}
2622
2623
2623
2624
fn check_method ( & @crate_ctxt ccx , & @ast:: method method) {
2624
- auto m = method. node . meth ;
2625
- check_fn ( ccx, m. decl , m. proto , m. body , method. node . id ) ;
2625
+ check_fn ( ccx, method. node . meth , method. node . id ) ;
2626
2626
}
2627
2627
2628
2628
fn check_item ( @crate_ctxt ccx , & @ast:: item it) {
@@ -2631,10 +2631,10 @@ fn check_item(@crate_ctxt ccx, &@ast::item it) {
2631
2631
check_const ( ccx, it. span , e, it. id ) ;
2632
2632
}
2633
2633
case ( ast:: item_fn ( ?f, _) ) {
2634
- check_fn ( ccx, f. decl , f . proto , f . body , it. id ) ;
2634
+ check_fn ( ccx, f, it. id ) ;
2635
2635
}
2636
2636
case ( ast:: item_res ( ?f, ?dtor_id, _, _) ) {
2637
- check_fn ( ccx, f. decl , f . proto , f . body , dtor_id) ;
2637
+ check_fn ( ccx, f, dtor_id) ;
2638
2638
}
2639
2639
case ( ast:: item_obj ( ?ob, _, _) ) {
2640
2640
// We're entering an object, so gather up the info we need.
0 commit comments