Skip to content
Permalink
Browse files

Panic when unmatched delimiters aren't emitted

  • Loading branch information...
estebank committed Mar 3, 2019
1 parent e38e915 commit c70a516c23ae19ce568166a81e64c92a4ecf540a
Showing with 8 additions and 1 deletion.
  1. +1 −1 src/libsyntax/ext/tt/macro_parser.rs
  2. +7 −0 src/libsyntax/parse/parser.rs
@@ -761,7 +761,7 @@ pub fn parse(
else if bb_items.is_empty() && next_items.is_empty() {
return Failure(
parser.span,
parser.token,
parser.token.clone(),
"no rules expected this token in macro call",
);
}
@@ -259,6 +259,13 @@ pub struct Parser<'a> {
last_unexpected_token_span: Option<Span>,
}

impl<'a> Drop for Parser<'a> {
fn drop(&mut self) {
if !self.unclosed_delims.is_empty() {
panic!("unclosed delimiter errors not emitted");
}
}
}

#[derive(Clone)]
struct TokenCursor {

0 comments on commit c70a516

Please sign in to comment.
You can’t perform that action at this time.