Skip to content
Permalink
Browse files

Always emit mismatched delim errors, never panic

  • Loading branch information...
estebank committed Mar 3, 2019
1 parent ac6cc2d commit f156d9220703d99709be32ea1be0be0d44535114
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/libsyntax/parse/parser.rs
@@ -262,7 +262,8 @@ pub struct Parser<'a> {
impl<'a> Drop for Parser<'a> {
fn drop(&mut self) {
if !self.unclosed_delims.is_empty() {
panic!("unclosed delimiter errors not emitted");
let diag = self.diagnostic();
emit_unclosed_delims(&mut self.unclosed_delims, diag);
}
}
}
@@ -8567,8 +8568,6 @@ impl<'a> Parser<'a> {
module: self.parse_mod_items(&token::Eof, lo)?,
span: lo.to(self.span),
});
let diag = self.diagnostic();
emit_unclosed_delims(&mut self.unclosed_delims, diag);
krate
}

0 comments on commit f156d92

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