Repository navigation
Conversation
|
The parser was modified, potentially altering the grammar of (stable) Rust cc @fmease |
|
r? @aerooneqq rustbot has assigned @aerooneqq. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
@lazerg given your recent streak of patches, can you please disclose your LLM usage (if any)? thanks |
|
Yes, I prepare these patches with Claude Code (Claude Opus 5.5). |
|
Submitting such patches without disclosure of LLM usage up-front is incorrect. Please read the LLM usage policy. |
| if self.check_ident() | ||
| && !matches!(self.token.ident(), Some((_, IdentKind::ForcedKeyword))) | ||
| && self.look_ahead(1, |t| *t == token::Comma || *t == token::CloseParen) | ||
| { | ||
| // `fn foo(String s) {}` | ||
| let ident = self.parse_ident_common(true).unwrap(); |
There was a problem hiding this comment.
| if let Some(ident) = self.token.non_reserved_ident() | |
| && self.look_ahead(1, |t| *t == token::Comma || *t == token::CloseParen) | |
| { | |
| // `fn foo(String s) {}` | |
| self.bump(); // ident |
| let ident = if self.token.is_ident() | ||
| && !matches!(self.token.ident(), Some((_, IdentKind::ForcedKeyword))) | ||
| && (!is_const || self.look_ahead(1, |t| *t == token::OpenParen)) | ||
| && self.look_ahead(1, |t| { | ||
| matches!(t.kind, token::Lt | token::OpenBrace | token::OpenParen) | ||
| }) { | ||
| self.parse_ident_common(true).unwrap() |
There was a problem hiding this comment.
Similarly, (pseudo)
if is_ident() && !matches!(ForcedKeyword) ... { parse_ident_common().unwrap()`to (pseudo)
if let Some(ident) = self.token.non_reserved_ident() ... { self.bump(); // ident|
Reminder, once the PR becomes ready for a review, use |
|
Hi, For the last few months we have been receiving an increased amount of slop by users running bots that generate contributions, and even misconfiguring their bot so it will even send generated apology emails on top. We have no way to distinguish your PR from your other generated ones and no way to determine whether you actually want to contribute. We are a community of contributors, not just a code repository. Thus we focus on contributors who desire to stay around and put in the work to produce high quality contributions or learn to do so. We are thus banning you as per our policies (1) and contribution standards (2). You can contact the moderation team to discuss and possibly reconsider your ban. Thanks for understanding Oli in the name of the mod team |
…-kw-param-without-type, r=fmease fix ICE when a forced keyword follows a parameter pattern This is a resubmission of rust-lang#165700 by lazerg. Fixes rust-lang#165690 r? fmease
…-kw-param-without-type, r=fmease fix ICE when a forced keyword follows a parameter pattern This is a resubmission of rust-lang#165700 by lazerg. Fixes rust-lang#165690 r? fmease
…-without-type, r=fmease fix ICE when a forced keyword follows a parameter pattern This is a resubmission of rust-lang/rust#165700 by lazerg. Fixes rust-lang/rust#165690 r? fmease
For
fn bar(S k#self) {}, the C-style parameter recovery (fn foo(String s)) saw an identifier token after the pattern and unwrappedparse_ident_common(true), but that returns an error for forced keywords instead of recovering, so the parser ICEd. Forced keywords are never identifiers, so the recovery now skips them and we report the normal "expected one of:,@, or|" error. The missingfn/structkeyword recovery had the same unwrap (pub k#self() {}ICEd too), so it gets the same check.Fixes #165690