diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs index 36d705f35969..3522c8863cf5 100644 --- a/src/libsyntax/ext/tt/macro_rules.rs +++ b/src/libsyntax/ext/tt/macro_rules.rs @@ -291,17 +291,16 @@ pub fn compile<'cx>(cx: &'cx mut ExtCtxt, let lhses = match **argument_map.get(&lhs_nm.name).unwrap() { MatchedSeq(ref s, _) => { s.iter().map(|m| match **m { - MatchedNonterminal(NtTT(ref tt)) => (**tt).clone(), + MatchedNonterminal(NtTT(ref tt)) => { + valid &= check_lhs_nt_follows(cx, tt); + (**tt).clone() + } _ => cx.span_bug(def.span, "wrong-structured lhs") }).collect() } _ => cx.span_bug(def.span, "wrong-structured lhs") }; - for lhs in &lhses { - valid &= check_lhs_nt_follows(cx, lhs); - } - let rhses = match **argument_map.get(&rhs_nm.name).unwrap() { MatchedSeq(ref s, _) => { s.iter().map(|m| match **m {