Skip to content

Commit da10471

Browse files
committed
---
yaml --- r: 3924 b: refs/heads/master c: e2fcd29 h: refs/heads/master v: v3
1 parent e8a1dd0 commit da10471

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 53c4cb6a2fa99df20a2cd720890e888402773fe7
2+
refs/heads/master: e2fcd29bbd7dc58b4af5f498cb1f323822ffc254

trunk/src/comp/middle/typeck.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,7 @@ type gather_result =
11631163
hashmap[ast::node_id, ast::ident] local_names,
11641164
int next_var_id);
11651165

1166-
fn gather_locals(&@crate_ctxt ccx, &ast::fn_decl decl, &ast::block body,
1166+
fn gather_locals(&@crate_ctxt ccx, &ast::_fn f,
11671167
&ast::node_id id) -> gather_result {
11681168
fn next_var_id(@mutable int nvi) -> int {
11691169
auto rv = *nvi;
@@ -1207,8 +1207,8 @@ fn gather_locals(&@crate_ctxt ccx, &ast::fn_decl decl, &ast::block body,
12071207
auto args = ty::ty_fn_args(ccx.tcx, ty::node_id_to_type(ccx.tcx, id));
12081208
auto i = 0u;
12091209
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));
12121212
i += 1u;
12131213
}
12141214
// Add explicitly-declared locals.
@@ -1253,7 +1253,7 @@ fn gather_locals(&@crate_ctxt ccx, &ast::fn_decl decl, &ast::block body,
12531253
visit_pat_pre=bind visit_pat_pre(ccx, vb, locals, local_names,
12541254
nvi, _)
12551255
with walk::default_visitor());
1256-
walk::walk_block(visit, body);
1256+
walk::walk_block(visit, f.body);
12571257
ret rec(var_bindings=vb,
12581258
locals=locals,
12591259
local_names=local_names,
@@ -1999,7 +1999,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
19991999
collect::ty_of_fn_decl(cx, convert, ty_of_arg, f.decl,
20002000
f.proto, ~[], none)._1;
20012001
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);
20032003
}
20042004
case (ast::expr_block(?b)) {
20052005
check_block(fcx, b);
@@ -2577,9 +2577,10 @@ fn check_const(&@crate_ctxt ccx, &span sp, &@ast::expr e, &ast::node_id id) {
25772577
check_expr(fcx, e);
25782578
}
25792579

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);
25832584
let ast::node_id[] fixups = ~[];
25842585
let @fn_ctxt fcx =
25852586
@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,
26212622
}
26222623

26232624
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);
26262626
}
26272627

26282628
fn check_item(@crate_ctxt ccx, &@ast::item it) {
@@ -2631,10 +2631,10 @@ fn check_item(@crate_ctxt ccx, &@ast::item it) {
26312631
check_const(ccx, it.span, e, it.id);
26322632
}
26332633
case (ast::item_fn(?f, _)) {
2634-
check_fn(ccx, f.decl, f.proto, f.body, it.id);
2634+
check_fn(ccx, f, it.id);
26352635
}
26362636
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);
26382638
}
26392639
case (ast::item_obj(?ob, _, _)) {
26402640
// We're entering an object, so gather up the info we need.

0 commit comments

Comments
 (0)