Skip to content

fix(query): Pass Query Key to value_from_cycle_error#153694

Merged
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
TKanX:bugfix/153391-cycle-error-key-param
Mar 12, 2026
Merged

fix(query): Pass Query Key to value_from_cycle_error#153694
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
TKanX:bugfix/153391-cycle-error-key-param

Conversation

@TKanX
Copy link
Contributor

@TKanX TKanX commented Mar 11, 2026

View all comments

Summary:

Pass the query key directly to value_from_cycle_error so that FromCycleError impls (notably FnSig) can use the recovered query's DefId instead of relying on cycle[0], which is arbitrarily rotated by the parallel deadlock handler.

As suggested in #153644 (comment).

Closes #153391

r? @nnethercote
cc @zetanumbers

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 11, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 11, 2026

Failed to set assignee to zetanumbers: invalid assignee

Note: Only org members with at least the repository "read" role, users with write permissions, or people who have commented on the PR may be assigned.

@rust-log-analyzer

This comment has been minimized.

@TKanX TKanX force-pushed the bugfix/153391-cycle-error-key-param branch from c1f26e9 to 6118290 Compare March 11, 2026 07:05
@TKanX TKanX marked this pull request as ready for review March 11, 2026 08:13
@rustbot rustbot 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 Mar 11, 2026
@rustbot

This comment has been minimized.

@rust-bors

This comment has been minimized.

@zetanumbers
Copy link
Contributor

This needs a rebase, sorry for an inconvenience. You are a half way there, but you would need to remove QueryKey::key_as_def_id call you have added and use query key directly to extract the function's arity within rustc_query_impl::from_cycle_error::fn_sig.

@zetanumbers
Copy link
Contributor

@rustbot author

@rustbot rustbot 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 Mar 11, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 11, 2026

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

@TKanX TKanX marked this pull request as draft March 11, 2026 09:29
@TKanX TKanX force-pushed the bugfix/153391-cycle-error-key-param branch from 6118290 to 5986684 Compare March 11, 2026 09:56
@TKanX TKanX marked this pull request as ready for review March 11, 2026 09:57
@rustbot rustbot 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 Mar 11, 2026
@rustbot

This comment has been minimized.

@nnethercote
Copy link
Contributor

FYI: #153707 is also changing this code, replacing the guar parameter with err. It is compatible with this change, but whichever PR merges first will cause conflicts with the other. Apologies for any confusion, I didn't realize @zetanumbers was handing out pieces of this work to other people.

@zetanumbers
Copy link
Contributor

I had done some recruitment into query system. I thought it was clear from #153493 (comment)

@zetanumbers
Copy link
Contributor

This PR also fixes #142064 as we no longer rely on a reported query cycle and whatever permutation it has, which was the source of that problem.

@zetanumbers
Copy link
Contributor

LGTM

@zetanumbers
Copy link
Contributor

@bors ready

If only I could've

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 11, 2026

Unknown command "ready". Run @bors help to see available commands.

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Mar 12, 2026
…nnethercote

fix(query): Pass Query Key to `value_from_cycle_error`



### Summary:

Pass the query key directly to `value_from_cycle_error` so that `FromCycleError` impls (notably `FnSig`) can use the recovered query's `DefId` instead of relying on `cycle[0]`, which is arbitrarily rotated by the parallel deadlock handler.

As suggested in [#153644 (comment)](#153644 (comment)).

Closes #153391 

r? @nnethercote 
cc @zetanumbers
@rust-bors rust-bors bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 12, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 12, 2026

💔 Test for ecf0b12 failed: CI. Failed job:

@nnethercote
Copy link
Contributor

GitHub flakiness.

@bors retry

@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 Mar 12, 2026
Zalathar added a commit to Zalathar/rust that referenced this pull request Mar 12, 2026
…y-param, r=nnethercote

fix(query): Pass Query Key to `value_from_cycle_error`

### Summary:

Pass the query key directly to `value_from_cycle_error` so that `FromCycleError` impls (notably `FnSig`) can use the recovered query's `DefId` instead of relying on `cycle[0]`, which is arbitrarily rotated by the parallel deadlock handler.

As suggested in [rust-lang#153644 (comment)](rust-lang#153644 (comment)).

Closes rust-lang#153391

r? @nnethercote
cc @zetanumbers
@rust-log-analyzer
Copy link
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)

Zalathar added a commit to Zalathar/rust that referenced this pull request Mar 12, 2026
…y-param, r=nnethercote

fix(query): Pass Query Key to `value_from_cycle_error`

### Summary:

Pass the query key directly to `value_from_cycle_error` so that `FromCycleError` impls (notably `FnSig`) can use the recovered query's `DefId` instead of relying on `cycle[0]`, which is arbitrarily rotated by the parallel deadlock handler.

As suggested in [rust-lang#153644 (comment)](rust-lang#153644 (comment)).

Closes rust-lang#153391

r? @nnethercote
cc @zetanumbers
rust-bors bot pushed a commit that referenced this pull request Mar 12, 2026
Rollup of 7 pull requests

Successful merges:

 - #153736 (add test that an incomplete feature emits a warning)
 - #153160 (Fix relative extern URL depth on source pages)
 - #153432 (Fix some comments about dataflow analysis.)
 - #153694 (fix(query): Pass Query Key to `value_from_cycle_error`)
 - #153717 (unused_macro_rules switched used and unused comments)
 - #153748 (editorconfig: css uses tabs)
 - #153750 (rustc-dev-guide subtree update)
@nnethercote
Copy link
Contributor

@bors retry

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 12, 2026

❗ You can only retry pull requests that are approved and have a previously failed auto build.

Zalathar added a commit to Zalathar/rust that referenced this pull request Mar 12, 2026
…y-param, r=nnethercote

fix(query): Pass Query Key to `value_from_cycle_error`

### Summary:

Pass the query key directly to `value_from_cycle_error` so that `FromCycleError` impls (notably `FnSig`) can use the recovered query's `DefId` instead of relying on `cycle[0]`, which is arbitrarily rotated by the parallel deadlock handler.

As suggested in [rust-lang#153644 (comment)](rust-lang#153644 (comment)).

Closes rust-lang#153391

r? @nnethercote
cc @zetanumbers
rust-bors bot pushed a commit that referenced this pull request Mar 12, 2026
Rollup of 11 pull requests

Successful merges:

 - #153726 (Add optional CI job to build the compiler with the parallel frontend)
 - #153763 (Don't add empty target features for target-cpu=native on macOS)
 - #153432 (Fix some comments about dataflow analysis.)
 - #153529 (Fix LegacyKeyValueFormat report from docker build: pr)
 - #153694 (fix(query): Pass Query Key to `value_from_cycle_error`)
 - #153708 (de-non_const `Iterator` trait methods)
 - #153717 (unused_macro_rules switched used and unused comments)
 - #153736 (add test that an incomplete feature emits a warning)
 - #153748 (editorconfig: css uses tabs)
 - #153750 (rustc-dev-guide subtree update)
 - #153762 (actually make the is-fn test test what it says it tests)
@Zalathar
Copy link
Member

@bors try jobs=x86_64-rust-for-linux

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Mar 12, 2026
…<try>

fix(query): Pass Query Key to `value_from_cycle_error`


try-job: x86_64-rust-for-linux
Zalathar added a commit to Zalathar/rust that referenced this pull request Mar 12, 2026
…y-param, r=nnethercote

fix(query): Pass Query Key to `value_from_cycle_error`

### Summary:

Pass the query key directly to `value_from_cycle_error` so that `FromCycleError` impls (notably `FnSig`) can use the recovered query's `DefId` instead of relying on `cycle[0]`, which is arbitrarily rotated by the parallel deadlock handler.

As suggested in [rust-lang#153644 (comment)](rust-lang#153644 (comment)).

Closes rust-lang#153391

r? @nnethercote
cc @zetanumbers
rust-bors bot pushed a commit that referenced this pull request Mar 12, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #153726 (Add optional CI job to build the compiler with the parallel frontend)
 - #153763 (Don't add empty target features for target-cpu=native on macOS)
 - #153432 (Fix some comments about dataflow analysis.)
 - #153529 (Fix LegacyKeyValueFormat report from docker build: pr)
 - #153694 (fix(query): Pass Query Key to `value_from_cycle_error`)
 - #153717 (unused_macro_rules switched used and unused comments)
 - #153736 (add test that an incomplete feature emits a warning)
 - #153748 (editorconfig: css uses tabs)
 - #153750 (rustc-dev-guide subtree update)
 - #153762 (actually make the is-fn test test what it says it tests)
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 12, 2026

☀️ Try build successful (CI)
Build commit: 2d2b643 (2d2b643a7715fbf3cec5cd7f6831d0cea0d1300c, parent: d1ee5e59a964a419b84b760812a35075034f4861)

@rust-bors rust-bors bot merged commit 04cf753 into rust-lang:main Mar 12, 2026
12 of 13 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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]: parallel: None in compiler/rustc_type_ir/src/ty_kind.rs

6 participants