Skip to content

Commit 85879b7

Browse files
committed
---
yaml --- r: 5181 b: refs/heads/master c: b6e6f8b h: refs/heads/master i: 5179: b4fa7b9 v: v3
1 parent 2796b50 commit 85879b7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
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: 87c6416d0caff986965a40b038c919d12014ee30
2+
refs/heads/master: b6e6f8b8103a5e7e5de30076aea18fce13d3fd61

trunk/src/comp/middle/resolve.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ fn resolve_names(e: &@env, c: &@ast::crate) {
275275
visit_item: visit_item_with_scope,
276276
visit_block: visit_block_with_scope,
277277
visit_decl: visit_decl_with_scope,
278-
visit_arm: walk_arm,
278+
visit_arm: visit_arm_with_scope,
279279
visit_pat: bind walk_pat(e, _, _, _),
280280
visit_expr: bind walk_expr(e, _, _, _),
281281
visit_ty: bind walk_ty(e, _, _, _),
@@ -310,9 +310,6 @@ fn resolve_names(e: &@env, c: &@ast::crate) {
310310
sc: &scopes, _v: &vt<scopes>) {
311311
maybe_insert(e, id, lookup_path_strict(*e, sc, sp, p.node, ns_value));
312312
}
313-
fn walk_arm(a: &ast::arm, sc: &scopes, v: &vt<scopes>) {
314-
visit_arm_with_scope(a, sc, v);
315-
}
316313
fn walk_pat(e: &@env, pat: &@ast::pat, sc: &scopes, v: &vt<scopes>) {
317314
visit::visit_pat(pat, sc, v);
318315
alt pat.node {
@@ -398,7 +395,10 @@ fn visit_decl_with_scope(d: &@decl, sc: &scopes, v: &vt<scopes>) {
398395
}
399396

400397
fn visit_arm_with_scope(a: &ast::arm, sc: &scopes, v: &vt<scopes>) {
401-
visit::visit_arm(a, cons(scope_arm(a), @sc), v);
398+
for p: @pat in a.pats { v.visit_pat(p, sc, v); }
399+
let sc_inner = cons(scope_arm(a), @sc);
400+
visit::visit_expr_opt(a.guard, sc_inner, v);
401+
v.visit_block(a.body, sc_inner, v);
402402
}
403403

404404
fn visit_expr_with_scope(x: &@ast::expr, sc: &scopes, v: &vt<scopes>) {

0 commit comments

Comments
 (0)