1
Fork 0

Rollup merge of #108297 - chenyukang:yukang/delim-error-exit, r=petrochenkov

Exit when there are unmatched delims to avoid noisy diagnostics

From https://github.com/rust-lang/rust/pull/104012#issuecomment-1311764832
r? ``@petrochenkov``
This commit is contained in:
Matthias Krüger 2023-03-01 01:20:22 +01:00 committed by GitHub
commit 371904bba6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
106 changed files with 325 additions and 1586 deletions

View file

@ -19,7 +19,7 @@ use crate::errors::{
};
use crate::fluent_generated as fluent;
use crate::lexer::UnmatchedBrace;
use crate::lexer::UnmatchedDelim;
use crate::parser;
use rustc_ast as ast;
use rustc_ast::ptr::P;
@ -222,7 +222,7 @@ impl MultiSugg {
/// is dropped.
pub struct SnapshotParser<'a> {
parser: Parser<'a>,
unclosed_delims: Vec<UnmatchedBrace>,
unclosed_delims: Vec<UnmatchedDelim>,
}
impl<'a> Deref for SnapshotParser<'a> {
@ -264,7 +264,7 @@ impl<'a> Parser<'a> {
self.unclosed_delims.extend(snapshot.unclosed_delims);
}
pub fn unclosed_delims(&self) -> &[UnmatchedBrace] {
pub fn unclosed_delims(&self) -> &[UnmatchedDelim] {
&self.unclosed_delims
}