Emit unclosed delimiters during recovery
This commit is contained in:
parent
cc535a2a19
commit
ed2de5a842
@ -778,6 +778,7 @@ impl<'a> Parser<'a> {
|
||||
// leave it in the input
|
||||
Ok(false)
|
||||
} else if self.last_unexpected_token_span == Some(self.span) {
|
||||
emit_unclosed_delims(&self.unclosed_delims, self.diagnostic());
|
||||
FatalError.raise();
|
||||
} else {
|
||||
let mut expected = edible.iter()
|
||||
|
@ -5,4 +5,8 @@ impl A {
|
||||
//~^ ERROR expected one of `)`, `,`, or `:`, found `>`
|
||||
}
|
||||
|
||||
// verify that mismatched delimiters get emitted
|
||||
fn foo(] {}
|
||||
//~^ ERROR incorrect close delimiter
|
||||
|
||||
fn main() {}
|
||||
|
@ -7,5 +7,13 @@ LL | fn b(self> {}
|
||||
| | help: `)` may belong here
|
||||
| unclosed delimiter
|
||||
|
||||
error: aborting due to previous error
|
||||
error: incorrect close delimiter: `]`
|
||||
--> $DIR/issue-58856-1.rs:9:8
|
||||
|
|
||||
LL | fn foo(] {}
|
||||
| -^ incorrect close delimiter
|
||||
| |
|
||||
| un-closed delimiter
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user