Rollup merge of #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 https://github.com/rust-lang-nursery/rustfmt/issues/2791.
This commit is contained in:
commit
aa3a6273af
1 changed files with 1 additions and 1 deletions
|
@ -4709,7 +4709,7 @@ impl<'a> Parser<'a> {
|
|||
if macro_legacy_warnings && self.token != token::Semi {
|
||||
self.warn_missing_semicolon();
|
||||
} else {
|
||||
self.expect_one_of(&[token::Semi], &[])?;
|
||||
self.expect_one_of(&[], &[token::Semi])?;
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue