Skip to content

Commit 0924cce

Browse files
committed
---
yaml --- r: 121851 b: refs/heads/master c: a18a631 h: refs/heads/master i: 121849: 5ba53f3 121847: 4dcc71b v: v3
1 parent 8f0dd77 commit 0924cce

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
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 84e8143c4f423011cd337d2a7bfdc54a753eea81
2+
refs/heads/master: a18a63185ca79126842d94505746fccef3ade1b8
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: afdfe40aa0b7dfc7800dddbc1f55da979abfe486
55
refs/heads/try: 18dc3bc9e3314a250c0718ab329938e676410cdf

trunk/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)