Skip to content
Permalink
Browse files

Emit unclosed delimiters during recovery

  • Loading branch information...
estebank committed Mar 2, 2019
1 parent cc535a2 commit ed2de5a8421822ecf9aa3df30bc6c2e55d4ea97d
@@ -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

0 comments on commit ed2de5a

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