Fix error recovery in format macro parsing

This commit is contained in:
Fabian Wolff 2021-09-10 22:33:44 +02:00
parent 497ee321af
commit a8421cacfe
4 changed files with 94 additions and 18 deletions

View file

@ -277,7 +277,7 @@ impl<'a> Parser<'a> {
self.struct_span_err(sp, &msg)
.span_suggestion_short(sp, "change this to `;`", ";".to_string(), appl)
.emit();
return Ok(false);
return Ok(true);
} else if self.look_ahead(0, |t| {
t == &token::CloseDelim(token::Brace)
|| (
@ -295,7 +295,7 @@ impl<'a> Parser<'a> {
.span_label(self.token.span, "unexpected token")
.span_suggestion_short(sp, "add `;` here", ";".to_string(), appl)
.emit();
return Ok(false);
return Ok(true);
}
}