Skip to content

Commit c594bc7

Browse files
committed
---
yaml --- r: 131533 b: refs/heads/dist-snap c: 6bee3c8 h: refs/heads/master i: 131531: 15045d9 v: v3
1 parent c5331c3 commit c594bc7

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 457a3c991d79b971be07fce75f9d0c12848fb37c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 35175f015ff878d49e3b5562fe3a7addcef25cfc
9+
refs/heads/dist-snap: 6bee3c87c94a39fb7d48a119bbc105149c345bfc
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libsyntax/ext/expand.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -667,19 +667,14 @@ fn expand_arm(arm: &ast::Arm, fld: &mut MacroExpander) -> ast::Arm {
667667
// code duplicated from 'let', above. Perhaps this can be lifted
668668
// into a separate function:
669669
let idents = pattern_bindings(*first_pat);
670-
let mut new_pending_renames =
670+
let new_pending_renames =
671671
idents.iter().map(|id| (*id,fresh_name(id))).collect();
672-
// rewrite all of the patterns using the new names (the old
673-
// ones have already been applied). Note that we depend here
674-
// on the guarantee that after expansion, there can't be any
675-
// Path expressions (a.k.a. varrefs) left in the pattern. If
676-
// this were false, we'd need to apply this renaming only to
677-
// the bindings, and not to the varrefs, using a more targeted
678-
// fold-er.
679-
let mut rename_fld = IdentRenamer{renames:&mut new_pending_renames};
672+
// apply the renaming, but only to the PatIdents:
673+
let mut rename_pats_fld = PatIdentRenamer{renames:&new_pending_renames};
680674
let rewritten_pats =
681-
expanded_pats.iter().map(|pat| rename_fld.fold_pat(*pat)).collect();
675+
expanded_pats.iter().map(|pat| rename_pats_fld.fold_pat(*pat)).collect();
682676
// apply renaming and then expansion to the guard and the body:
677+
let mut rename_fld = IdentRenamer{renames:&new_pending_renames};
683678
let rewritten_guard =
684679
arm.guard.map(|g| fld.fold_expr(rename_fld.fold_expr(g)));
685680
let rewritten_body = fld.fold_expr(rename_fld.fold_expr(arm.body));

0 commit comments

Comments
 (0)