-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
fn foo() {
let _ = 3;;;;
}
Given the above example, the rustc parser used to silently drop the redundant semicolons (;;;
) from the AST. However, recently the parse has changed how it treats the redundant semicolons - they are now parsed as a semicolon statement with an empty tuple:
Stmt {
node: StmtKind::Semi(Expr {
node: ExprKind::Tup(vec![]),
..
}),
..
}
Found this while updating rustc-ap-syntax to 562.0.0 (which is built from the commit fc8765d) in rustfmt.
Metadata
Metadata
Assignees
Labels
A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.