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

Minor improvement on else-no-if diagnostic #97370

Merged
merged 1 commit into from
May 25, 2022

Conversation

compiler-errors
Copy link
Member

Don't suggest wrapping in block since it's highly likely to be a missing if after else. Also rework message a bit (open to further suggestions).

cc: #97298 (comment)

r? @estebank

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 24, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 24, 2022
@Dylan-DPC
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 25, 2022

📌 Commit d61d30d has been approved by Dylan-DPC

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 25, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request May 25, 2022
Rollup of 5 pull requests

Successful merges:

 - rust-lang#95953 (Modify MIR building to drop repeat expressions with length zero)
 - rust-lang#96913 (RFC3239: Implement `cfg(target)` - Part 2)
 - rust-lang#97233 ([RFC 2011] Library code)
 - rust-lang#97370 (Minor improvement on else-no-if diagnostic)
 - rust-lang#97384 (Fix metadata stats.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit fe727e4 into rust-lang:master May 25, 2022
@rustbot rustbot added this to the 1.63.0 milestone May 25, 2022
@estebank
Copy link
Contributor

I'm wondering @compiler-errors if we should also try and account for the case where the user writes } else if { where the condition is missing 🤔

@compiler-errors
Copy link
Member Author

that shouldn't be hard to do, i think

@compiler-errors compiler-errors deleted the else-no-if-2 branch August 11, 2023 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants