Skip to content
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

Improve check for presence of statements in a block #4628

Merged

Conversation

calebcartwright
Copy link
Member

Closes #4627

@@ -4,4 +4,6 @@ fn bar() {
for _ in 0..1 {}
}

fn baz() {}
fn baz() {
();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were only doing this before because at the time this issue was resolved the rustc parser/AST didn't allow us to differentiate between these empty tuple exprs in statement position and a plain old empty semi ;

@calebcartwright calebcartwright merged commit 94f17f8 into rust-lang:master Jan 7, 2021
@calebcartwright calebcartwright deleted the empty-stmts-blocks branch January 7, 2021 03:17
@karyon
Copy link
Contributor

karyon commented Oct 25, 2021

backport: #4674

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Naked semicolon in an empty body needs to be formatted twice
2 participants