Skip to content

Commit 01559fb

Browse files
authored
add an explanatory comment for recovery behavior
1 parent 18580e2 commit 01559fb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/libsyntax/parse/parser.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2531,6 +2531,9 @@ impl<'a> Parser<'a> {
25312531
e.span_label(struct_sp, "while parsing this struct");
25322532
e.emit();
25332533

2534+
// If the next token is a comma, then try to parse
2535+
// what comes next as additional fields, rather than
2536+
// bailing out until next `}`.
25342537
if self.token != token::Comma {
25352538
self.recover_stmt();
25362539
break;

0 commit comments

Comments
 (0)