Skip to content

Commit aa3a627

Browse files
authored
Rollup merge of rust-lang#51629 - topecongiro:multiple-semicolon-in-local-span, r=petrochenkov
Do not consume semicolon twice while parsing local statement The span for a `let` statement includes multiple semicolons. For example, ```rust let x = 2;;; // ^^^^^^^^^^^ The span for the above statement. ``` This PR fixes it. cc rust-lang/rustfmt#2791.
2 parents 8ef9e2c + cafe9d0 commit aa3a627

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libsyntax/parse/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4709,7 +4709,7 @@ impl<'a> Parser<'a> {
47094709
if macro_legacy_warnings && self.token != token::Semi {
47104710
self.warn_missing_semicolon();
47114711
} else {
4712-
self.expect_one_of(&[token::Semi], &[])?;
4712+
self.expect_one_of(&[], &[token::Semi])?;
47134713
}
47144714
}
47154715
_ => {}

0 commit comments

Comments
 (0)