Skip to content

Avoid &raw call recovery inside nested delimiters#157888

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
TaKO8Ki:fix-raw-ref-nested-call-arg-recover
Jun 14, 2026
Merged

Avoid &raw call recovery inside nested delimiters#157888
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
TaKO8Ki:fix-raw-ref-nested-call-arg-recover

Conversation

@TaKO8Ki

@TaKO8Ki TaKO8Ki commented Jun 14, 2026

Copy link
Copy Markdown
Member

Fixes #157853

The &raw <expr> recovery is only valid for malformed raw refs directly in the call argument list. When it handled the nested array case, it tried to skip tokens until the call's ), reached the nested ], and could ICE in parse_token_tree.

This PR scopes the call-argument recovery to the call's delimiter depth and makes the recovery loop stop before any closing delimiter or EOF.

@rustbot

rustbot commented Jun 14, 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 14, 2026
@rustbot

rustbot commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

r? @folkertdev

rustbot has assigned @folkertdev.
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 20 candidates

@TaKO8Ki TaKO8Ki force-pushed the fix-raw-ref-nested-call-arg-recover branch from 9d91d02 to 33d1436 Compare June 14, 2026 13:39
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

A job failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@folkertdev

Copy link
Copy Markdown
Contributor

Nice!

@bors r+ rollup

@rust-bors

rust-bors Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 33d1436 has been approved by folkertdev

It is now in the queue for this repository.

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

Rollup of 5 pull requests

Successful merges:

 - #157677 (Slightly improve diagnostic impl+output for uncovered type parameters)
 - #157715 (Stop using a fn pointer to normalize_fn_sig inside TypeErrCtxt)
 - #157884 (Rename `errors.rs` file to `diagnostics.rs` (9/N))
 - #157887 (Rename `diagnostic::on_unmatch_args` to `diagnostic::on_unmatched_args`)
 - #157888 (Avoid `&raw` call recovery inside nested delimiters)
@rust-bors rust-bors Bot merged commit 243521a into rust-lang:main Jun 14, 2026
15 of 26 checks passed
@rustbot rustbot added this to the 1.98.0 milestone Jun 14, 2026
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