Conversation
|
(rustbot has picked a reviewer for you, use r? to override) |
|
The issue has the following idea:
Presumably because some people try to use |
|
r? diagnostics |
|
@rustbot ready |
|
I'm still not confident that this is the right place to put this code. Have you tried placing the recovery into Ideally, we'd consolidate this code into that as well: rust/compiler/rustc_parse/src/parser/item.rs Lines 72 to 76 in 21f6839 |
|
rust/compiler/rustc_parse/src/parser/item.rs Lines 67 to 80 in 21f6839 When i converted the code above to this: I got this weird error when Also when moving the recover code to |
|
☔ The latest upstream changes (presumably #105670) made this pull request unmergeable. Please resolve the merge conflicts. |
(edited) I'm not sure. You need to share an example of the code :/
I guess that's a good point :/ |
eda2aaf to
85a20ab
Compare
|
☔ The latest upstream changes (presumably #107840) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@rustbot author |
|
@rustbot ready |
|
☔ The latest upstream changes (presumably #108682) made this pull request unmergeable. Please resolve the merge conflicts. |
|
r? @Nilstrieb since you like reviewing parser recoveries 😸 and i've given this pr enough review, and don't want to block it |
| "expected item" | ||
| }; | ||
| err.span_label(self.token.span, label); | ||
| if self.is_kw_followed_by_ident(kw::Let) { |
| // Do not attempt to parse an expression if we're done here. | ||
| self.error_outer_attrs(attrs); | ||
| self.mk_stmt(lo, StmtKind::Empty) | ||
| } else if self.prev_token.is_keyword(kw::Pub) && self.token.is_keyword(kw::Let) { |
There was a problem hiding this comment.
The name of the function is parse_stmt_without_recovery, so I don't think it's a good idea to do recovery here. I think there was some kind of other function that gets called on invalid statements (I forgot the name but -Ztreat-err-as-bug may guide you there). Maybe you could check there?
|
@obeis any updates on this? |
|
Closing this as inactive. Feel free to reöpen this pr or create a new pr if you get the time to work on this. Thanks |
Closes #101622