From a99767f64f400f694aec02655af4b5cb5913609e Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Tue, 5 Jun 2018 13:04:15 -0400 Subject: add an explanatory comment for recovery behavior --- src/libsyntax/parse/parser.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 456054ee251..dfd896fbda4 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -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; -- cgit 1.4.1-3-g733a5