Skip to content

Conversation

@nnethercote
Copy link
Contributor

Towards the goal of eliminating rustc_query_system, this commit moves some code from rustc_query_system to rustc_middle and rustc_query_impl, and from rustc_middle to rustc_query_impl.

r? @Zalathar

Keys and values now must be `Copy` due to erasing.
The derived version is equivalent to the hand-written version.
@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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 Feb 10, 2026
@nnethercote
Copy link
Contributor Author

cc @cjgillot @Zoxc

@nnethercote
Copy link
Contributor Author

Shouldn't affect perf, let's check:

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Feb 10, 2026
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 10, 2026
@rust-log-analyzer

This comment has been minimized.

The latter is a new module.

As well as the code motion, some other changes were required.
- `QueryJobId` methods became free functions so they could move while
  `QueryJobId` itself stayed put. This was so `QueryMap` and
  `QueryJobInfo` could be moved.
- Some visibilities in `rustc_query_system` required changing.
- `collect_active_jobs_from_all_queries` is no longer required in `trait
  QueryContext`.
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 10, 2026

☀️ Try build successful (CI)
Build commit: 142cef8 (142cef8324cd1d0899762050200d95e5d20c632a, parent: 381e9ef09effbed5f1378a24dc6e461fea35a0e1)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (142cef8): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.1% [0.1%, 0.1%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.2%, -0.0%] 5
All ❌✅ (primary) - - 0

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results (secondary 1.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
5.7% [2.2%, 12.4%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-5.0% [-6.8%, -3.5%] 3
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 509.869s -> 476.022s (-6.64%)
Artifact size: 398.00 MiB -> 397.97 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 10, 2026
Because all uses are now in `rustc_query_impl`. This was made possible
by the previous commit. Less code in `rustc_middle`, hooray.
From `rustc_query_system::query::job` to `rustc_query_impl::job`.
@nnethercote nnethercote force-pushed the mv-more-query-system-code branch from c06b080 to a34317e Compare February 10, 2026 07:46
@Zalathar
Copy link
Member

Looks good, thanks.

@bors r+ rollup=maybe

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 10, 2026

📌 Commit a34317e has been approved by Zalathar

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 Feb 10, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 10, 2026
…ode, r=Zalathar

Move more query system code

Towards the goal of eliminating `rustc_query_system`, this commit moves some code from `rustc_query_system` to `rustc_middle` and `rustc_query_impl`, and from `rustc_middle` to `rustc_query_impl`.

r? @Zalathar
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 10, 2026
…ode, r=Zalathar

Move more query system code

Towards the goal of eliminating `rustc_query_system`, this commit moves some code from `rustc_query_system` to `rustc_middle` and `rustc_query_impl`, and from `rustc_middle` to `rustc_query_impl`.

r? @Zalathar
rust-bors bot pushed a commit that referenced this pull request Feb 10, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #149937 (try enabling `linker-messages` by default again)
 - #151733 (Use function shims to make sure EII works on apple targets)
 - #152120 (Don't ICE on layout error in vtable computation)
 - #152419 (Move more query system code)
 - #152431 (Restrict the set of things that const stability can be applied to)
 - #152436 (Reenable a GCI+mGCA+GCPT test case)
 - #151142 (Support ADT types in type info reflection)
 - #152021 (Bump tvOS, visionOS and watchOS Aarch64 targets to tier 2)
 - #152146 (mGCA: Add associated const type check)
 - #152372 (style: remove unneeded trailing commas)
 - #152383 (BikeshedGuaranteedNoDrop trait: add comments indicating that it can be observed on stable)
 - #152397 (Update books)
 - #152441 (Fix typos and grammar in top-level and src/doc documentation)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 10, 2026
…ode, r=Zalathar

Move more query system code

Towards the goal of eliminating `rustc_query_system`, this commit moves some code from `rustc_query_system` to `rustc_middle` and `rustc_query_impl`, and from `rustc_middle` to `rustc_query_impl`.

r? @Zalathar
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 11, 2026
…ode, r=Zalathar

Move more query system code

Towards the goal of eliminating `rustc_query_system`, this commit moves some code from `rustc_query_system` to `rustc_middle` and `rustc_query_impl`, and from `rustc_middle` to `rustc_query_impl`.

r? @Zalathar
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 11, 2026
…ode, r=Zalathar

Move more query system code

Towards the goal of eliminating `rustc_query_system`, this commit moves some code from `rustc_query_system` to `rustc_middle` and `rustc_query_impl`, and from `rustc_middle` to `rustc_query_impl`.

r? @Zalathar
rust-bors bot pushed a commit that referenced this pull request Feb 11, 2026
Rollup of 10 pull requests

Successful merges:

 - #152120 (Don't ICE on layout error in vtable computation)
 - #152419 (Move more query system code)
 - #152431 (Restrict the set of things that const stability can be applied to)
 - #152436 (Reenable a GCI+mGCA+GCPT test case)
 - #152021 (Bump tvOS, visionOS and watchOS Aarch64 targets to tier 2)
 - #152146 (mGCA: Add associated const type check)
 - #152372 (style: remove unneeded trailing commas)
 - #152383 (BikeshedGuaranteedNoDrop trait: add comments indicating that it can be observed on stable)
 - #152397 (Update books)
 - #152441 (Fix typos and grammar in top-level and src/doc documentation)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 11, 2026
…ode, r=Zalathar

Move more query system code

Towards the goal of eliminating `rustc_query_system`, this commit moves some code from `rustc_query_system` to `rustc_middle` and `rustc_query_impl`, and from `rustc_middle` to `rustc_query_impl`.

r? @Zalathar
rust-bors bot pushed a commit that referenced this pull request Feb 11, 2026
Rollup of 9 pull requests

Successful merges:

 - #152419 (Move more query system code)
 - #152431 (Restrict the set of things that const stability can be applied to)
 - #152436 (Reenable a GCI+mGCA+GCPT test case)
 - #152021 (Bump tvOS, visionOS and watchOS Aarch64 targets to tier 2)
 - #152146 (mGCA: Add associated const type check)
 - #152372 (style: remove unneeded trailing commas)
 - #152383 (BikeshedGuaranteedNoDrop trait: add comments indicating that it can be observed on stable)
 - #152397 (Update books)
 - #152441 (Fix typos and grammar in top-level and src/doc documentation)
@rust-bors rust-bors bot merged commit 2194af9 into rust-lang:main Feb 12, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 12, 2026
rust-timer added a commit that referenced this pull request Feb 12, 2026
Rollup merge of #152419 - nnethercote:mv-more-query-system-code, r=Zalathar

Move more query system code

Towards the goal of eliminating `rustc_query_system`, this commit moves some code from `rustc_query_system` to `rustc_middle` and `rustc_query_impl`, and from `rustc_middle` to `rustc_query_impl`.

r? @Zalathar
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.

5 participants