Make ICE an error and use a sensible error message

This commit is contained in:
Andy Caldwell 2015-07-24 01:10:25 +00:00
parent 610d1e312f
commit 4f58db485d

View file

@ -302,8 +302,8 @@ fn check_lhs_nt_follows(cx: &mut ExtCtxt, lhs: &NamedMatch, sp: Span) {
tt @ &TtSequence(..) => {
check_matcher(cx, Some(tt).into_iter(), &Eof);
},
_ => cx.span_bug(sp, "wrong-structured lhs for follow check (didn't find \
a TtDelimited or TtSequence)")
_ => cx.span_err(sp, "Invalid macro matcher; matchers must be contained \
in balanced delimiters or a repetition indicator")
},
_ => cx.span_bug(sp, "wrong-structured lhs for follow check (didn't find a \
MatchedNonterminal)")