diff options
| author | colinmarsh19 <32608057+colinmarsh19@users.noreply.github.com> | 2017-11-25 08:38:30 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-11-25 08:38:30 -0700 |
| commit | aabacf791abb5d50ca1cf0239268b8ef72f8faaa (patch) | |
| tree | 4b516c3fcce03af9870d5323d5c2e10aaa18b1c6 /src/libsyntax/parse/parser.rs | |
| parent | cc6b88ccb2fd10c2ad04a30ba648a1e9abf7ba4b (diff) | |
| download | rust-aabacf791abb5d50ca1cf0239268b8ef72f8faaa.tar.gz rust-aabacf791abb5d50ca1cf0239268b8ef72f8faaa.zip | |
Remove semicolon note
Added note that specifies a semicolon should be removed after a given struct
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 6 |
1 files changed, 5 insertions, 1 deletions
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 { |
