Skip to content

Commit 93147bc

Browse files
committed
---
yaml --- r: 3948 b: refs/heads/master c: c610d02 h: refs/heads/master v: v3
1 parent a72867b commit 93147bc

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
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: 7caf8a0929a734876025d7d36bbcb21d1609ac51
2+
refs/heads/master: c610d027d9a0bc196d3449cb482c26b601853f0a

trunk/src/comp/middle/typeck.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1250,11 +1250,20 @@ fn gather_locals(&@crate_ctxt ccx, &ast::_fn f,
12501250
}
12511251
visit::visit_pat(p, e, v);
12521252
}
1253+
1254+
// Don't descend into fns and items
1255+
fn visit_fn[E](&ast::_fn f, &ast::ty_param[] tp, &span sp,
1256+
&ast::fn_ident i, ast::node_id id, &E e,
1257+
&visit::vt[E] v) {}
1258+
fn visit_item[E](&@ast::item i, &E e, &visit::vt[E] v) {}
1259+
12531260
auto visit =
12541261
@rec(visit_local=bind visit_local(ccx, vb, locals, local_names,
12551262
nvi, _, _, _),
12561263
visit_pat=bind visit_pat(ccx, vb, locals, local_names,
1257-
nvi, _, _, _)
1264+
nvi, _, _, _),
1265+
visit_fn=visit_fn,
1266+
visit_item=visit_item
12581267
with *visit::default_visitor());
12591268
visit::visit_block(f.body, (), visit::mk_vt(visit));
12601269
ret rec(var_bindings=vb,

0 commit comments

Comments
 (0)