about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2018-06-05 13:04:15 -0400
committerPietro Albini <pietro@pietroalbini.org>2018-06-22 11:38:38 +0200
commita99767f64f400f694aec02655af4b5cb5913609e (patch)
tree827d8c13d92996fae737ffa364cdbbb4519d7a05 /src/libsyntax/parse
parent815765dadeb011180ad3ea0ce02c9cc59f8c93cc (diff)
downloadrust-a99767f64f400f694aec02655af4b5cb5913609e.tar.gz
rust-a99767f64f400f694aec02655af4b5cb5913609e.zip
add an explanatory comment for recovery behavior
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs3
1 files changed, 3 insertions, 0 deletions
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;