We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
,
1 parent 7dae5c0 commit 7969b78Copy full SHA for 7969b78
src/libsyntax/parse/parser.rs
@@ -776,6 +776,9 @@ impl<'a> Parser<'a> {
776
err.span_label(self.span, format!("expected identifier, found {}", token_descr));
777
} else {
778
err.span_label(self.span, "expected identifier");
779
+ if self.token == token::Comma {
780
+ err.span_suggestion(self.span, "try removing a comma", ",".into());
781
+ }
782
}
783
err
784
@@ -2446,8 +2449,11 @@ impl<'a> Parser<'a> {
2446
2449
Err(mut e) => {
2447
2450
e.span_label(struct_sp, "while parsing this struct");
2448
2451
e.emit();
- self.recover_stmt();
- break;
2452
+
2453
+ if self.token != token::Comma {
2454
+ self.recover_stmt();
2455
+ break;
2456
2457
2458
2459
0 commit comments