Skip to content

Overhaul rustc_middle::query - #161433

Merged
rust-bors[bot] merged 8 commits into
rust-lang:mainfrom
nnethercote:overhaul-rustc_middle-query
Aug 26, 2026
Merged

Overhaul rustc_middle::query#161433
rust-bors[bot] merged 8 commits into
rust-lang:mainfrom
nnethercote:overhaul-rustc_middle-query

Conversation

@nnethercote

@nnethercote nnethercote commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Overhaul rustc_middle::query

The file/module structure is a mess. High-level changes:

  • The vaguely-named mish-mash file plumbing.rs is split across multiple other files.
  • The vaguely-named inner.rs gains some additions and becomes calls.rs.
  • system.rs is added.
  • New file query_api.rs is added. It contains the big macro, which is renamed from define_callbacks to define_query_api.

This is a follow-up to #160843, which did a similar restructuring of rustc_query_impl.

r? @Zalathar

Because `ActiveKeyStatus` wraps `QueryJob`, and `QueryState` is a
collection of `ActiveKeyStatus`es.
Because cycles are stored within `QueryWaiter`.

Also, rename `Cycle` as `QueryCycle`, to be less generic and match most
of the other nearby types.
@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 Aug 21, 2026
@rustbot

rustbot commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Zalathar is not on the review rotation at the moment.
They may take a while to respond.

@rust-log-analyzer

This comment has been minimized.

It gains three types from `plumbing.rs` that define the high level query
system structures.
@nnethercote
nnethercote force-pushed the overhaul-rustc_middle-query branch from 372e3b5 to d194c82 Compare August 21, 2026 03:51
@rust-log-analyzer

This comment has been minimized.

Because it's a clearer name.

Also move some call-related stuff from `plumbing.rs` to `calls.rs`.
At this point all `plumbing.rs` contains is the `define_callbacks!`
macro. Rename that macro as `define_query_api!` because it defines a lot
more than just callbacks. And also rename the file to match.
From `mod.rs` to `queries.rs`, the one file that uses it. This leaves
`mod.rs` containing only `use` and `mod` items.
@nnethercote
nnethercote force-pushed the overhaul-rustc_middle-query branch from d194c82 to 40e321a Compare August 21, 2026 07:13
@Zalathar Zalathar changed the title Overhaul rustc middle query Overhaul rustc_middle::query Aug 26, 2026
@Zalathar

Copy link
Copy Markdown
Member

Looks good, thanks.

@bors r+

@rust-bors

rust-bors Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 40e321a 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 Aug 26, 2026
@Kobzol

Kobzol commented Aug 26, 2026

Copy link
Copy Markdown
Member

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 26, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 26, 2026
rust-bors Bot pushed a commit that referenced this pull request Aug 26, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #161433 (Overhaul `rustc_middle::query`)
 - #158370 (rewrite never type documentation)
 - #160354 (update `ambiguous_glob_imported_trait` lint explanation and example.)
 - #161447 (Construct paramenvs from an iterator)
 - #161707 (pattern_type: make print format match the current syntax)
 - #161773 (Update WASI targets to wasi-sdk-34)
 - #161807 (bootstrap: skip StdarchVerify when remote testing is enabled)
@rust-bors

rust-bors Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 370ae5b (370ae5b673fcefc7398bd11b2da161421fac5cb8)
Base parent: 3ffb26f (3ffb26fbf5bf232cf59e314e75ea325973f4f583)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (370ae5b): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

This perf run didn't have relevant results for this metric.

Cycles

Results (primary 2.1%, secondary 13.5%)

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

mean range count
Regressions ❌
(primary)
2.1% [2.1%, 2.1%] 1
Regressions ❌
(secondary)
13.5% [3.3%, 18.3%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.1% [2.1%, 2.1%] 1

Binary size

Results (primary 0.1%, secondary 0.1%)

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

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

Bootstrap: 476.994s -> 476.802s (-0.04%)
Artifact size: 402.58 MiB -> 402.59 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 26, 2026
@rust-bors
rust-bors Bot merged commit 37fcc07 into rust-lang:main Aug 26, 2026
14 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Aug 26, 2026
rust-bors Bot pushed a commit that referenced this pull request Aug 26, 2026
Rollup merge of #161433 - nnethercote:overhaul-rustc_middle-query, r=Zalathar

Overhaul `rustc_middle::query`

Overhaul `rustc_middle::query`

The file/module structure is a mess. High-level changes:
- The vaguely-named mish-mash file `plumbing.rs` is split across multiple other files.
- The vaguely-named `inner.rs` gains some additions and becomes `calls.rs`.
- `system.rs` is added.
- New file `query_api.rs` is added. It contains the big macro, which is renamed from `define_callbacks` to `define_query_api`.

This is a follow-up to #160843, which did a similar restructuring of `rustc_query_impl`.

r? @Zalathar
@nnethercote
nnethercote deleted the overhaul-rustc_middle-query branch August 26, 2026 19:50
pull Bot pushed a commit to xtqqczze/rust-lang-miri that referenced this pull request Aug 27, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#161433 (Overhaul `rustc_middle::query`)
 - rust-lang/rust#158370 (rewrite never type documentation)
 - rust-lang/rust#160354 (update `ambiguous_glob_imported_trait` lint explanation and example.)
 - rust-lang/rust#161447 (Construct paramenvs from an iterator)
 - rust-lang/rust#161707 (pattern_type: make print format match the current syntax)
 - rust-lang/rust#161773 (Update WASI targets to wasi-sdk-34)
 - rust-lang/rust#161807 (bootstrap: skip StdarchVerify when remote testing is enabled)
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Aug 28, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#161433 (Overhaul `rustc_middle::query`)
 - rust-lang/rust#158370 (rewrite never type documentation)
 - rust-lang/rust#160354 (update `ambiguous_glob_imported_trait` lint explanation and example.)
 - rust-lang/rust#161447 (Construct paramenvs from an iterator)
 - rust-lang/rust#161707 (pattern_type: make print format match the current syntax)
 - rust-lang/rust#161773 (Update WASI targets to wasi-sdk-34)
 - rust-lang/rust#161807 (bootstrap: skip StdarchVerify when remote testing is enabled)
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.

6 participants