You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Redundant semicolons are parsed as an empty tuple semicolon statement #63679
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:
Ah, this is due to #62984, where we need to record the redundant semicolons for the lint. Sorry, I forgot that this would affect non-rustc parsing. We should change the representation, but I'm not sure what would be ideal. Perhaps storing the number of semicolons in StmtKind::Semi.
REDUNDANT_SEMICOLONS is now an internal lint, which seems to be using StmtKind::Empty instead of tuples. Also rustfmt automatically removes any redundant semicolons.
Activity
varkor commentedon Aug 18, 2019
Ah, this is due to #62984, where we need to record the redundant semicolons for the lint. Sorry, I forgot that this would affect non-rustc parsing. We should change the representation, but I'm not sure what would be ideal. Perhaps storing the number of semicolons in
StmtKind::Semi.GrigorenkoPV commentedon Sep 22, 2024
This should probably be closed.
REDUNDANT_SEMICOLONSis now an internal lint, which seems to be usingStmtKind::Emptyinstead of tuples. Alsorustfmtautomatically removes any redundant semicolons.