From aabacf791abb5d50ca1cf0239268b8ef72f8faaa Mon Sep 17 00:00:00 2001 From: colinmarsh19 <32608057+colinmarsh19@users.noreply.github.com> Date: Sat, 25 Nov 2017 08:38:30 -0700 Subject: Remove semicolon note Added note that specifies a semicolon should be removed after a given struct --- src/libsyntax/parse/parser.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/libsyntax/parse/parser.rs') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 0b03429ea2e..7a3009215f2 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -5486,7 +5486,11 @@ impl<'a> Parser<'a> { if !self.eat(term) { let token_str = self.this_token_to_string(); - return Err(self.fatal(&format!("expected item, found `{}`", token_str))); + let mut err = self.fatal(&format!("expected item, found `{}`", token_str)); + if token_str == ";" { + err.note("consider removing the semicolon"); + } + return Err(); } let hi = if self.span == syntax_pos::DUMMY_SP { -- cgit 1.4.1-3-g733a5