Skip to content

Commit 87a8374

Browse files
committed
---
yaml --- r: 152909 b: refs/heads/try2 c: a18a631 h: refs/heads/master i: 152907: 9119397 v: v3
1 parent 6f34b30 commit 87a8374

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
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: 84e8143c4f423011cd337d2a7bfdc54a753eea81
8+
refs/heads/try2: a18a63185ca79126842d94505746fccef3ade1b8
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: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -659,15 +659,15 @@ fn expand_non_macro_stmt(s: &Stmt, fld: &mut MacroExpander)
659659
}
660660

661661
fn expand_arm(arm: &ast::Arm, fld: &mut MacroExpander) -> ast::Arm {
662-
if a.pats.len() == 0 {
662+
if arm.pats.len() == 0 {
663663
fail!("encountered match arm with 0 patterns");
664664
}
665-
let first_pat = match a.pats.get(0) {
666-
667-
}
665+
// all of the pats must have the same set of bindings, so use the
666+
// first one to extract them and generate new names:
667+
let first_pat = arm.pats.get(0);
668668
// code duplicated from 'let', above. Perhaps this can be lifted
669669
// into a separate function:
670-
let expanded_pat = fld.fold_pat(pat);
670+
let expanded_pat = fld.fold_pat(*first_pat);
671671
let mut name_finder = new_name_finder(Vec::new());
672672
name_finder.visit_pat(&*expanded_pat,());
673673
let mut new_pending_renames = Vec::new();
@@ -681,13 +681,13 @@ fn expand_arm(arm: &ast::Arm, fld: &mut MacroExpander) -> ast::Arm {
681681
// ones have already been applied):
682682
rename_fld.fold_pat(expanded_pat)
683683
};
684-
685-
let bound_names
686-
ast::Arm {
687-
attrs: a.attrs.iter().map(|x| self.fold_attribute(*x)).collect(),
688-
pats: a.pats.iter().map(|x| self.fold_pat(*x)).collect(),
689-
guard: a.guard.map(|x| self.fold_expr(x)),
690-
body: self.fold_expr(a.body),
684+
/*
685+
*/
686+
ast::Arm {
687+
attrs: arm.attrs.iter().map(|x| fld.fold_attribute(*x)).collect(),
688+
pats: arm.pats.iter().map(|x| fld.fold_pat(*x)).collect(),
689+
guard: arm.guard.map(|x| fld.fold_expr(x)),
690+
body: fld.fold_expr(arm.body),
691691
}
692692
}
693693

0 commit comments

Comments
 (0)