Skip to content

Commit aabacf7

Browse files
authored
Remove semicolon note
Added note that specifies a semicolon should be removed after a given struct
1 parent cc6b88c commit aabacf7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/libsyntax/parse/parser.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5486,7 +5486,11 @@ impl<'a> Parser<'a> {
54865486

54875487
if !self.eat(term) {
54885488
let token_str = self.this_token_to_string();
5489-
return Err(self.fatal(&format!("expected item, found `{}`", token_str)));
5489+
let mut err = self.fatal(&format!("expected item, found `{}`", token_str));
5490+
if token_str == ";" {
5491+
err.note("consider removing the semicolon");
5492+
}
5493+
return Err();
54905494
}
54915495

54925496
let hi = if self.span == syntax_pos::DUMMY_SP {

0 commit comments

Comments
 (0)