add an explanatory comment for recovery behavior

This commit is contained in:
Niko Matsakis
2018-06-05 13:04:15 -04:00
committed by Pietro Albini
parent 815765dade
commit a99767f64f

View File

@@ -2450,6 +2450,9 @@ impl<'a> Parser<'a> {
e.span_label(struct_sp, "while parsing this struct");
e.emit();
// If the next token is a comma, then try to parse
// what comes next as additional fields, rather than
// bailing out until next `}`.
if self.token != token::Comma {
self.recover_stmt();
break;