Skip to content

Commit 54858d5

Browse files
committed
Fix regression
1 parent 3e22e0c commit 54858d5

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/libsyntax/parse/parser.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6307,7 +6307,7 @@ impl<'a> Parser<'a> {
63076307
if !self.eat(term) {
63086308
let token_str = self.this_token_descr();
63096309
let mut err = self.fatal(&format!("expected item, found {}", token_str));
6310-
if token_str == ";" {
6310+
if self.token == token::Semi {
63116311
let msg = "consider removing this semicolon";
63126312
err.span_suggestion_short_with_applicability(
63136313
self.span, msg, String::new(), Applicability::MachineApplicable

src/test/ui/issues/issue-46186.stderr

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ error: expected item, found `;`
22
--> $DIR/issue-46186.rs:13:2
33
|
44
LL | }; //~ ERROR expected item, found `;`
5-
| ^ expected item
5+
| ^ help: consider removing this semicolon
6+
|
7+
= help: braced struct declarations are not followed by a semicolon
68

79
error: aborting due to previous error
810

src/test/ui/issues/issue-49040.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error: expected item, found `;`
22
--> $DIR/issue-49040.rs:11:28
33
|
44
LL | #![allow(unused_variables)]; //~ ERROR expected item, found `;`
5-
| ^ expected item
5+
| ^ help: consider removing this semicolon
66

77
error: aborting due to previous error
88

0 commit comments

Comments
 (0)