-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Warn for extra semicolon #56338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Not sure this is lint-worthy as it doesn't change the semantics of the code. Is it removed by rustfmt? |
Currently rustfmt doesn't remove it.
From my experience when the code isn't clean, it could cause troubles for someone later. I prefer Rust code to be tidy, it causes less troubles. |
I don't think this should be a rustc's lint. It is an insignificant syntactic detail. There are much worse things like lack of indentation. I don't think we should warn those things either. Maybe it could be a clippy's lint (of pedant category). Currently, rustfmt cannot remove this extra semicolon because it requires semantical analysis and it only does syntactic analysis. We need to know if the type of the expression is |
If that's the consensus I'll move this issue to Clippy issues. |
@leonardo-m closing and linking from similar clippy issue. |
The closing semicolon of the match {} is not warned against by Rusts nor Clippy:
The text was updated successfully, but these errors were encountered: