-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Confusing suggestion on incorrect closing }
#70633
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
Oh, I though we had other tests covering this... that's my bad. I can be on favor of a better heuristic, for users of some editors this suggestion has been helpful. @kper could you give us an idea of what the code was when you got the bogus suggestion? We could, for example, detect empty blocks that are fully valid match arms and never suggest those. I think that's the most common source of these misleading suggestions. |
@estebank oh sorry, the PR didn't link the issue. (#70583)
Well the reason why I removed it, was the compiler returns this error message
Ok, I will try that, so I'll revert the removal. Is there anything else, I should put there instead? Because after the fix, the compiler will return a message which doesn't provide a suggestion.
|
@kper An option would be to keep track of when the last properly formed Also, for this case, ideally we would have output like
|
…t properly closed block.
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Thanks @estebank for the hint. Basically, that is what I'm doing right now. I keep track of my |
But, I have still some troubles with the tidy check. This is one of my tests. However,
PS: I've seen the typo |
Nevermind, I dropped a word. Those are the new error message after the PR. My changes led to changes in different tests too. I hope, that is fine. If not, please let me know. I dropped the term "but they don't match indentation" from your proposal because it might cause confusion in some cases (the last example below where the indentation is correct).
|
}
}
@bors r+ |
📌 Commit f96b92f has been approved by |
Rollup of 7 pull requests Successful merges: - rust-lang#70633 (Confusing suggestion on incorrect closing `}`) - rust-lang#71404 (Don't fuse Chain in its second iterator) - rust-lang#71408 (Check code blocks tags) - rust-lang#71442 (Add a "by reference" adaptor for `AllocRef`) - rust-lang#71446 (Only use read_unaligned in transmute_copy if necessary) - rust-lang#71470 (Fix doc links) - rust-lang#71479 (add back Scalar::null_ptr) Failed merges: r? @ghost
Compiler returns