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

Teach suspicious_else_formatting about if .. {..} {..} #3341

Merged
merged 2 commits into from
Dec 22, 2018

Conversation

HMPerson1
Copy link
Contributor

We essentially treat bare blocks {..} identically to if .. {..}, except for different lint messages.

Fixes #3044

@HMPerson1
Copy link
Contributor Author

This looks like a rustc bug: we got an ast::Expr whose Span is 0.

@HMPerson1
Copy link
Contributor Author

Minimal(-ish) reproducer here: https://github.com/HMPerson1/rustc-macros-span-bug

@HMPerson1
Copy link
Contributor Author

Reported as rust-lang/rust#55232

@HMPerson1 HMPerson1 force-pushed the possibly_missing_else branch from 1582a3f to faa029f Compare October 26, 2018 01:17
@phansch
Copy link
Member

phansch commented Dec 10, 2018

@HMPerson1 sorry this took so long to review, the changes look good to me! Could you rebase one more time?

@phansch phansch added the S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) label Dec 11, 2018
@HMPerson1 HMPerson1 force-pushed the possibly_missing_else branch from faa029f to c9e48ac Compare December 21, 2018 03:26
@HMPerson1 HMPerson1 force-pushed the possibly_missing_else branch from c9e48ac to 05ae391 Compare December 21, 2018 03:45
@phansch
Copy link
Member

phansch commented Dec 22, 2018

@bors r+ thanks!

@bors
Copy link
Contributor

bors commented Dec 22, 2018

📌 Commit 05ae391 has been approved by phansch

@bors
Copy link
Contributor

bors commented Dec 22, 2018

⌛ Testing commit 05ae391 with merge d9cc71f...

bors added a commit that referenced this pull request Dec 22, 2018
Teach `suspicious_else_formatting` about `if .. {..} {..}`

We essentially treat bare blocks `{..}` identically to `if .. {..}`, except for different lint messages.

Fixes #3044
@bors
Copy link
Contributor

bors commented Dec 22, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: phansch
Pushing d9cc71f to master...

@bors bors merged commit 05ae391 into rust-lang:master Dec 22, 2018
@HMPerson1 HMPerson1 deleted the possibly_missing_else branch December 23, 2018 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants