Skip to content

Commit b80f899

Browse files
committed
---
yaml --- r: 153113 b: refs/heads/try2 c: 6bee3c8 h: refs/heads/master i: 153111: 5afaa5f v: v3
1 parent 9df4477 commit b80f899

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
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 35175f015ff878d49e3b5562fe3a7addcef25cfc
8+
refs/heads/try2: 6bee3c87c94a39fb7d48a119bbc105149c345bfc
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/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)