We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3301f7 commit e9a6fc9Copy full SHA for e9a6fc9
src/comp/middle/trans.rs
@@ -4086,6 +4086,10 @@ fn collect_upvars(&@block_ctxt cx, &fn (&walk::ast_visitor) walker,
4086
resolve::def_map def_map,
4087
session::session sess);
4088
4089
+ fn walk_fn(env e, &ast::_fn f, &ast::ty_param[] tps, &span sp,
4090
+ &ast::fn_ident i, ast::node_id nid) {
4091
+ for (ast::arg a in f.decl.inputs) { e.decls.insert(a.id, ()); }
4092
+ }
4093
fn walk_expr(env e, &@ast::expr expr) {
4094
alt (expr.node) {
4095
case (ast::expr_path(?path)) {
@@ -4123,7 +4127,8 @@ fn collect_upvars(&@block_ctxt cx, &fn (&walk::ast_visitor) walker,
4123
4127
def_map=cx.fcx.lcx.ccx.tcx.def_map,
4124
4128
sess=cx.fcx.lcx.ccx.tcx.sess);
4125
4129
auto visitor =
4126
- @rec(visit_local_pre=bind walk_local(e, _),
4130
+ @rec(visit_fn_pre=bind walk_fn(e, _, _, _, _, _),
4131
+ visit_local_pre=bind walk_local(e, _),
4132
visit_expr_pre=bind walk_expr(e, _),
4133
visit_pat_pre=bind walk_pat(e, _)
4134
with walk::default_visitor());
0 commit comments