Suggest if-let chain continuation on unclosed delimiter - #160592
Conversation
|
The parser was modified, potentially altering the grammar of (stable) Rust cc @fmease |
|
Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @JohnTitor (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
87cc2ee to
68e51b9
Compare
This comment has been minimized.
This comment has been minimized.
68e51b9 to
39b3ad8
Compare
|
I seriously thought getting something working was going to be more complex than this ^_^' We'd want to add some complexity later to better customize the message (there are some cases where this wasn't a let chain), but I'm ok with this for now. @bors r+ |
Meant to fix #160550. When an unclosed brace-delimited block begins with && or ||, the "unclosed delimiter" error now points at that line, suggesting the user may have meant to continue an if-let chain.
&&/||span during lexing (in lex_token_tree_open_delim) and surfaces it in report_suspicious_mismatch_block.tests/ui/parserregression test.