Skip to content

Incorporate query description functions into QueryVTable - #152153

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
Zalathar:descs
Feb 5, 2026
Merged

Incorporate query description functions into QueryVTable#152153
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
Zalathar:descs

Conversation

@Zalathar

Copy link
Copy Markdown
Member

Putting a desc function in each query vtable reduces the amount of parameter juggling required when creating query stack frames, because almost all of the necessary information can be found in the vtable.

There should be no change to compiler output.

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

Copy link
Copy Markdown
Collaborator

r? @madsmtm

rustbot has assigned @madsmtm.
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

@Zalathar

Copy link
Copy Markdown
MemberAuthor

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-borsBot pushed a commit that referenced this pull request Feb 5, 2026
Incorporate query description functions into `QueryVTable`
@rustbotrustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 5, 2026
@Zalathar

Copy link
Copy Markdown
MemberAuthor

cc @nnethercote (more query cleanups)


/// Functions that format a human-readable description of each query
/// and its key, as specified by the `desc` query modifier.
pub mod _description_fns {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the leading _?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a comment to explain my two reasons:

  • It reduces the possibility of colliding with the name of an actual query when expanded inside rustc_middle::queries.
  • It reduces the possibility of colliding with other identifier names when searching, which is handy for macro-generated code.
    • This is not such a big deal with the new, more verbose name, but it was a recurring hassle when the module was named descs.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@nnethercote

Copy link
Copy Markdown
Contributor

r=me if you want it, once my question above has been considered.

@rust-bors

rust-borsBot commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 466a290 (466a2905703eaaa0cd15510a298269276885f319, parent: 9f4b56a5aed81e8c36cc26b3c1b4666ead6b71fc)

@rust-timer

This comment has been minimized.

@madsmtmmadsmtm assigned nnethercote and unassigned madsmtmFeb 5, 2026
@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (466a290): comparison URL.

Overall result: no relevant changes - 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

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

Max RSS (memory usage)

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

Cycles

Results (secondary 3.1%)

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

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
3.1%[3.1%, 3.1%]1
Improvements ✅
(primary)
--0
Improvements ✅
(secondary)
--0
All ❌✅ (primary)--0

Binary size

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

Bootstrap: 474.797s -> 474.291s (-0.11%)
Artifact size: 397.94 MiB -> 397.96 MiB (0.00%)

@rustbotrustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 5, 2026
@Zalathar

Copy link
Copy Markdown
MemberAuthor

@bors r=nnethercote rollup=maybe

@rust-bors

rust-borsBot commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 4382206 has been approved by nnethercote

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 Feb 5, 2026
rust-borsBot pushed a commit that referenced this pull request Feb 5, 2026
…uwer
Rollup of 9 pull requests
Successful merges:
- #150831 (c-variadic: make `va_arg` match on `Arch` exhaustive)
- #152113 (Fix GitHub CI summary in CodeBuild)
- #152153 (Incorporate query description functions into `QueryVTable`)
- #152070 (Convert to inline diagnostics in `rustc_pattern_analysis`)
- #152106 (Convert to inline diagnostics in `rustc_ast_passes`)
- #152109 (Convert to inline diagnostics in `rustc_errors`)
- #152119 (Convert to inline diagnostics in `rustc_middle`)
- #152121 (Convert to inline diagnostics in `rustc_builtin_macros`)
- #152133 (library/std: Rename `ON_BROKEN_PIPE_FLAG_USED` to `ON_BROKEN_PIPE_USED`)
Failed merges:
- #152107 (Convert to inline diagnostics in `rustc_borrowck`)
- #152117 (Convert to inline diagnostics in `rustc_trait_selection`)
- #152126 (Convert to inline diagnostics in `rustc_mir_build`)
- #152131 (Port rustc_no_implicit_bounds attribute to parser.)
@rust-bors
rust-borsBot merged commit ce3df42 into rust-lang:mainFeb 5, 2026
11 checks passed
@rustbotrustbot added this to the 1.95.0 milestone Feb 5, 2026
rust-timer added a commit that referenced this pull request Feb 5, 2026
Rollup merge of #152153 - Zalathar:descs, r=nnethercote
Incorporate query description functions into `QueryVTable`
Putting a `desc` function in each query vtable reduces the amount of parameter juggling required when creating query stack frames, because almost all of the necessary information can be found in the vtable.
There should be no change to compiler output.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-query-systemArea: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html)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.

5 participants

@Zalathar@rustbot@rust-timer@nnethercote@madsmtm