Skip to content

resolve: Inherit eager invocation parents - #159242

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
Dnreikronos:resolver/eager_invocation_parent
Jul 15, 2026
Merged

resolve: Inherit eager invocation parents#159242
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
Dnreikronos:resolver/eager_invocation_parent

Conversation

@Dnreikronos

@DnreikronosDnreikronos commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Fixes#159233

format! eagerly expands its first arg. In this case that path ran into a glob delegation from fn_delegation, and resolver tried to read invocation_parents[invoc_id] for an eager invocation that never went through reduced-graph collection. So a bad input got an ICE instead of normal errors.

This makes eager invocations copy InvocationParent from the eager expansion root, matching the parent-scope fallback already there. imo this is the right place to fix it: idk of a cleaner split where the scope and parent def do not drift apart. fyi the UI regression is the reported case, btw, and it still emits the expected user-facing errors without the panic.

@rustbotrustbot 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 Jul 13, 2026
@rustbot

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 75 candidates
  • Random selection from 18 candidates

@Dnreikronos
Dnreikronos marked this pull request as draft July 13, 2026 17:03
@rustbotrustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 13, 2026
@petrochenkov

Copy link
Copy Markdown
Contributor

r? @petrochenkov

@Dnreikronos
Dnreikronos marked this pull request as ready for review July 13, 2026 19:24
@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 13, 2026
Comment threadtests/ui/delegation/eager-format-glob-delegation-ice-159233.rs Outdated
Comment threadtests/ui/delegation/eager-format-glob-delegation-ice-159233.rs Outdated
Comment threadcompiler/rustc_resolve/src/macros.rs Outdated
Comment threadcompiler/rustc_resolve/src/macros.rs Outdated
@petrochenkovpetrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 14, 2026
@Dnreikronos

Copy link
Copy Markdown
ContributorAuthor

@rustbot ready

@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 14, 2026
@petrochenkov

Copy link
Copy Markdown
Contributor

r=me after squashing commits and green CI.
@rustbot author

@rustbotrustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 14, 2026
@rustbot

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@Dnreikronos
Dnreikronosforce-pushed the resolver/eager_invocation_parent branch from fbb5670 to c8fe362CompareJuly 14, 2026 14:05
@Dnreikronos

Copy link
Copy Markdown
ContributorAuthor

@rustbot ready

@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 14, 2026
@Dnreikronos

Copy link
Copy Markdown
ContributorAuthor

@bors r=petrochenkov

@rust-bors

rust-borsBot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@Dnreikronos: 🔑 Insufficient privileges: not in review users

@Dnreikronos

Copy link
Copy Markdown
ContributorAuthor

Sorry for the noise, looks like I don't have bors review privileges here. The commits are squashed and CI is green now.

@petrochenkov

Copy link
Copy Markdown
Contributor

@bors r+

@rust-bors

rust-borsBot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

📌 Commit c8fe362 has been approved by petrochenkov

It is now in the queue for this repository.

@rust-borsrust-borsBot 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 Jul 14, 2026
@jhprattjhpratt mentioned this pull request Jul 15, 2026
rust-borsBot pushed a commit that referenced this pull request Jul 15, 2026
Rollup of 15 pull requests
Successful merges:
- #159311 (Add 1.97.1 release notes)
- #156220 (Implement `VecDeque::truncate_to_range`)
- #158608 (Implement `#[diagnostic::opaque]` attribute to hide backtraces of macros.)
- #159168 (Fix static_mut_refs lint check logic)
- #159242 (resolve: Inherit eager invocation parents)
- #159256 (Account for async closures when pointing at lifetime in return type)
- #159310 (cleanup: upstream dropped AMX-TF32)
- #158348 (Add documentation for the `inline` attribute)
- #159181 (add rustc_no_writable to mem::forget and structs it uses)
- #159191 (Mark `PrivateItems` with `std_internals` unstable feature.)
- #159194 (rustdoc: Fix auto trait normalization env)
- #159196 (OnceCell: Improve wording in module docs)
- #159289 (Fix Zulip backport command suggestion)
- #159294 (renovate: don't update PRs in the merge queue)
- #159305 (std: clarify available_parallelism docs for Windows 11 processor groups)
@rust-bors
rust-borsBot merged commit 58f1e26 into rust-lang:mainJul 15, 2026
13 checks passed
@rustbotrustbot added this to the 1.99.0 milestone Jul 15, 2026
rust-timer added a commit that referenced this pull request Jul 15, 2026
Rollup merge of #159242 - Dnreikronos:resolver/eager_invocation_parent, r=petrochenkov
resolve: Inherit eager invocation parents
Fixes#159233
`format!` eagerly expands its first arg. In this case that path ran into a glob delegation from `fn_delegation`, and resolver tried to read `invocation_parents[invoc_id]` for an eager invocation that never went through reduced-graph collection. So a bad input got an ICE instead of normal errors.
This makes eager invocations copy `InvocationParent` from the eager expansion root, matching the parent-scope fallback already there. imo this is the right place to fix it: idk of a cleaner split where the scope and parent def do not drift apart. fyi the UI regression is the reported case, btw, and it still emits the expected user-facing errors without the panic.
pullBot pushed a commit to LeeeeeeM/miri that referenced this pull request Jul 16, 2026
Rollup of 15 pull requests
Successful merges:
- rust-lang/rust#159311 (Add 1.97.1 release notes)
- rust-lang/rust#156220 (Implement `VecDeque::truncate_to_range`)
- rust-lang/rust#158608 (Implement `#[diagnostic::opaque]` attribute to hide backtraces of macros.)
- rust-lang/rust#159168 (Fix static_mut_refs lint check logic)
- rust-lang/rust#159242 (resolve: Inherit eager invocation parents)
- rust-lang/rust#159256 (Account for async closures when pointing at lifetime in return type)
- rust-lang/rust#159310 (cleanup: upstream dropped AMX-TF32)
- rust-lang/rust#158348 (Add documentation for the `inline` attribute)
- rust-lang/rust#159181 (add rustc_no_writable to mem::forget and structs it uses)
- rust-lang/rust#159191 (Mark `PrivateItems` with `std_internals` unstable feature.)
- rust-lang/rust#159194 (rustdoc: Fix auto trait normalization env)
- rust-lang/rust#159196 (OnceCell: Improve wording in module docs)
- rust-lang/rust#159289 (Fix Zulip backport command suggestion)
- rust-lang/rust#159294 (renovate: don't update PRs in the merge queue)
- rust-lang/rust#159305 (std: clarify available_parallelism docs for Windows 11 processor groups)
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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]: resolve: no entry found for key

4 participants

@Dnreikronos@rustbot@petrochenkov@dingxiangfei2009