Skip to content

Commit e663815

Browse files
committed
Regarding rust-lang#50974: showing help message to remove comma
1 parent 242195d commit e663815

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
@@ -767,6 +767,9 @@ impl<'a> Parser<'a> {
767767
err.span_label(self.span, format!("expected identifier, found {}", token_descr));
768768
} else {
769769
err.span_label(self.span, "expected identifier");
770+
if self.token == token::Comma {
771+
err.span_suggestion(self.span, "remove this comma", ",".into());
772+
}
770773
}
771774
err
772775
}

0 commit comments

Comments
 (0)