Skip to content

Avoid &raw recovery ICE after trailing comma#157978

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
TaKO8Ki:fix-raw-ref-trailing-comma-recovery
Jun 22, 2026
Merged

Avoid &raw recovery ICE after trailing comma#157978
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
TaKO8Ki:fix-raw-ref-trailing-comma-recovery

Conversation

@TaKO8Ki

@TaKO8Ki TaKO8Ki commented Jun 16, 2026

Copy link
Copy Markdown
Member

Fixes #157950

This is a follow up to #157888.

For &raw x,), recovery first skips x, then consumes the trailing comma. The old condition then fell through to parse_token_tree() when the next token was ), which causes an ICE.

@rustbot

rustbot commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

The parser was modified, potentially altering the grammar of (stable) Rust
which would be a breaking change.

cc @fmease

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 16, 2026
@rustbot

rustbot commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

r? @dingxiangfei2009

rustbot has assigned @dingxiangfei2009.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 73 candidates
  • Random selection from 19 candidates

@TaKO8Ki

TaKO8Ki commented Jun 22, 2026

Copy link
Copy Markdown
Member Author

r? compiler

@JonathanBrouwer JonathanBrouwer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rust-bors

rust-bors Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 034044f has been approved by JonathanBrouwer

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 5. This pull request will be tested once the tree is reopened.

@rust-bors rust-bors Bot 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 Jun 22, 2026
rust-bors Bot pushed a commit that referenced this pull request Jun 22, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #158242 (Fix linking for wasm with crate metadata included)
 - #157978 (Avoid `&raw` recovery ICE after trailing comma)
 - #158119 (Refactor `proc_macro_decls_static`)
 - #158171 (rustdoc: Avoid ICE on unevaluated `type const` projections in array lengths)
 - #158172 (update `asm_experimental_reg` comments)
 - #158230 (Include `Item::stability` info in rustdoc JSON.)
 - #158258 (Use an unexpanded span for actually written down opt out params)
 - #158262 (Change compiler leads in triagebot.toml)
rust-bors Bot pushed a commit that referenced this pull request Jun 22, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #158242 (Fix linking for wasm with crate metadata included)
 - #157978 (Avoid `&raw` recovery ICE after trailing comma)
 - #158119 (Refactor `proc_macro_decls_static`)
 - #158171 (rustdoc: Avoid ICE on unevaluated `type const` projections in array lengths)
 - #158172 (update `asm_experimental_reg` comments)
 - #158230 (Include `Item::stability` info in rustdoc JSON.)
 - #158258 (Use an unexpanded span for actually written down opt out params)
 - #158262 (Change compiler leads in triagebot.toml)
rust-bors Bot pushed a commit that referenced this pull request Jun 22, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #158242 (Fix linking for wasm with crate metadata included)
 - #157978 (Avoid `&raw` recovery ICE after trailing comma)
 - #158119 (Refactor `proc_macro_decls_static`)
 - #158171 (rustdoc: Avoid ICE on unevaluated `type const` projections in array lengths)
 - #158172 (update `asm_experimental_reg` comments)
 - #158230 (Include `Item::stability` info in rustdoc JSON.)
 - #158258 (Use an unexpanded span for actually written down opt out params)
 - #158262 (Change compiler leads in triagebot.toml)
rust-bors Bot pushed a commit that referenced this pull request Jun 22, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #158242 (Fix linking for wasm with crate metadata included)
 - #157978 (Avoid `&raw` recovery ICE after trailing comma)
 - #158119 (Refactor `proc_macro_decls_static`)
 - #158171 (rustdoc: Avoid ICE on unevaluated `type const` projections in array lengths)
 - #158172 (update `asm_experimental_reg` comments)
 - #158230 (Include `Item::stability` info in rustdoc JSON.)
 - #158258 (Use an unexpanded span for actually written down opt out params)
 - #158262 (Change compiler leads in triagebot.toml)
@rust-bors rust-bors Bot merged commit a419aaf into rust-lang:main Jun 22, 2026
13 checks passed
@rustbot rustbot added this to the 1.98.0 milestone Jun 22, 2026
rust-timer added a commit that referenced this pull request Jun 22, 2026
Rollup merge of #157978 - TaKO8Ki:fix-raw-ref-trailing-comma-recovery, r=JonathanBrouwer

Avoid `&raw` recovery ICE after trailing comma

Fixes #157950

This is a follow up to #157888.

For `&raw x,)`, recovery first skips `x`, then consumes the trailing comma. The old condition then fell through to `parse_token_tree()` when the next token was `)`, which causes an ICE.
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.

[ICE]: !self.token.kind.is_close_delim_or_eof()

4 participants