Skip to content

Conversation

@Zalathar
Copy link
Member

@Zalathar Zalathar commented Jan 24, 2026

This type is used by dependency-tracking code in the query system, for looking up function pointers and other metadata associated with a particular DepKind.

Calling it “struct” is not particularly helpful, whereas calling it a “vtable” at least gives some basic intuition for what it is and how it is used.

Some associated identifiers have also drifted a bit over time, and this PR adjusts those as well.

There should be no change to compiler behaviour.

r? nnethercote (or compiler)

@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 Jan 24, 2026
@Zalathar
Copy link
Member Author

I was also planning some other related changes to this code (e.g. pulling more code out of macros), but I decided to stick with just the rename for this PR.

@Kivooeo
Copy link
Member

Kivooeo commented Jan 24, 2026

i really like this renaming prs in query system, it always was a mystery to me, good opportunity to know more about it

feel free to assign those to me, when it's not something very specific

r? me

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 24, 2026

📌 Commit 4b25ccd has been approved by Kivooeo

It is now in the queue for this repository.

@rust-bors rust-bors bot added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 24, 2026
@rust-bors rust-bors bot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 24, 2026
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 24, 2026
Rename `DepKindStruct` to `DepKindVTable`

This type is used by dependency-tracking code in the query system, for looking up function pointers and other metadata associated with a particular `DepKind`.

Calling it “struct” is not particularly helpful, whereas calling it a “vtable” at least gives some basic intuition for what it is and how it is used.

Some associated identifiers have also drifted a bit over time, and this PR adjusts those as well.

There should be no change to compiler behaviour.

r? nnethercote (or compiler)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 24, 2026
Rename `DepKindStruct` to `DepKindVTable`

This type is used by dependency-tracking code in the query system, for looking up function pointers and other metadata associated with a particular `DepKind`.

Calling it “struct” is not particularly helpful, whereas calling it a “vtable” at least gives some basic intuition for what it is and how it is used.

Some associated identifiers have also drifted a bit over time, and this PR adjusts those as well.

There should be no change to compiler behaviour.

r? nnethercote (or compiler)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 24, 2026
Rename `DepKindStruct` to `DepKindVTable`

This type is used by dependency-tracking code in the query system, for looking up function pointers and other metadata associated with a particular `DepKind`.

Calling it “struct” is not particularly helpful, whereas calling it a “vtable” at least gives some basic intuition for what it is and how it is used.

Some associated identifiers have also drifted a bit over time, and this PR adjusts those as well.

There should be no change to compiler behaviour.

r? nnethercote (or compiler)
rust-bors bot pushed a commit that referenced this pull request Jan 25, 2026
Rollup of 8 pull requests

Successful merges:

 - #145393 (Add codegen test for removing trailing zeroes from `NonZero`)
 - #149869 (std: avoid tearing `dbg!` prints)
 - #150065 (add CSE optimization tests for iterating over slice)
 - #150842 (Fix(lib/win/thread): Ensure `Sleep`'s usage passes over the requested duration under Win7)
 - #151244 (Refine dummy_span.rs test)
 - #151505 (Various refactors to the proc_macro bridge)
 - #151560 (relnotes: fix 1.93's `as_mut_array` methods)
 - #151577 (Rename `DepKindStruct` to `DepKindVTable`)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jan 25, 2026
Rename `DepKindStruct` to `DepKindVTable`

This type is used by dependency-tracking code in the query system, for looking up function pointers and other metadata associated with a particular `DepKind`.

Calling it “struct” is not particularly helpful, whereas calling it a “vtable” at least gives some basic intuition for what it is and how it is used.

Some associated identifiers have also drifted a bit over time, and this PR adjusts those as well.

There should be no change to compiler behaviour.

r? nnethercote (or compiler)
Copy link
Contributor

@nnethercote nnethercote left a comment

Choose a reason for hiding this comment

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

Yeah, this is good. Thanks for doing it.

View changes since this review

rust-bors bot pushed a commit that referenced this pull request Jan 25, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #145393 (Add codegen test for removing trailing zeroes from `NonZero`)
 - #148764 (ptr_aligment_type: add more APIs)
 - #149869 (std: avoid tearing `dbg!` prints)
 - #150065 (add CSE optimization tests for iterating over slice)
 - #150842 (Fix(lib/win/thread): Ensure `Sleep`'s usage passes over the requested duration under Win7)
 - #151505 (Various refactors to the proc_macro bridge)
 - #151560 (relnotes: fix 1.93's `as_mut_array` methods)
 - #151611 (Improve is_ascii performance on x86_64 with explicit SSE2 intrinsics)
 - #151317 (x86 soft-float feature: mark it as forbidden rather than unstable)
 - #151577 (Rename `DepKindStruct` to `DepKindVTable`)
 - #151620 (Fix 'the the' typo in library/core/src/array/iter.rs)
rust-bors bot pushed a commit that referenced this pull request Jan 25, 2026
Rollup of 10 pull requests

Successful merges:

 - #145393 (Add codegen test for removing trailing zeroes from `NonZero`)
 - #148764 (ptr_aligment_type: add more APIs)
 - #149869 (std: avoid tearing `dbg!` prints)
 - #150065 (add CSE optimization tests for iterating over slice)
 - #150842 (Fix(lib/win/thread): Ensure `Sleep`'s usage passes over the requested duration under Win7)
 - #151505 (Various refactors to the proc_macro bridge)
 - #151560 (relnotes: fix 1.93's `as_mut_array` methods)
 - #151317 (x86 soft-float feature: mark it as forbidden rather than unstable)
 - #151577 (Rename `DepKindStruct` to `DepKindVTable`)
 - #151620 (Fix 'the the' typo in library/core/src/array/iter.rs)
@rust-bors rust-bors bot merged commit 119eea2 into rust-lang:main Jan 25, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Jan 25, 2026
rust-timer added a commit that referenced this pull request Jan 25, 2026
Rollup merge of #151577 - Zalathar:dep-kind-vtable, r=Kivooeo

Rename `DepKindStruct` to `DepKindVTable`

This type is used by dependency-tracking code in the query system, for looking up function pointers and other metadata associated with a particular `DepKind`.

Calling it “struct” is not particularly helpful, whereas calling it a “vtable” at least gives some basic intuition for what it is and how it is used.

Some associated identifiers have also drifted a bit over time, and this PR adjusts those as well.

There should be no change to compiler behaviour.

r? nnethercote (or compiler)
@Zalathar Zalathar deleted the dep-kind-vtable branch January 25, 2026 13:34
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jan 26, 2026
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#145393 (Add codegen test for removing trailing zeroes from `NonZero`)
 - rust-lang/rust#148764 (ptr_aligment_type: add more APIs)
 - rust-lang/rust#149869 (std: avoid tearing `dbg!` prints)
 - rust-lang/rust#150065 (add CSE optimization tests for iterating over slice)
 - rust-lang/rust#150842 (Fix(lib/win/thread): Ensure `Sleep`'s usage passes over the requested duration under Win7)
 - rust-lang/rust#151505 (Various refactors to the proc_macro bridge)
 - rust-lang/rust#151560 (relnotes: fix 1.93's `as_mut_array` methods)
 - rust-lang/rust#151317 (x86 soft-float feature: mark it as forbidden rather than unstable)
 - rust-lang/rust#151577 (Rename `DepKindStruct` to `DepKindVTable`)
 - rust-lang/rust#151620 (Fix 'the the' typo in library/core/src/array/iter.rs)
lnicola pushed a commit to lnicola/rust-analyzer that referenced this pull request Jan 27, 2026
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#145393 (Add codegen test for removing trailing zeroes from `NonZero`)
 - rust-lang/rust#148764 (ptr_aligment_type: add more APIs)
 - rust-lang/rust#149869 (std: avoid tearing `dbg!` prints)
 - rust-lang/rust#150065 (add CSE optimization tests for iterating over slice)
 - rust-lang/rust#150842 (Fix(lib/win/thread): Ensure `Sleep`'s usage passes over the requested duration under Win7)
 - rust-lang/rust#151505 (Various refactors to the proc_macro bridge)
 - rust-lang/rust#151560 (relnotes: fix 1.93's `as_mut_array` methods)
 - rust-lang/rust#151317 (x86 soft-float feature: mark it as forbidden rather than unstable)
 - rust-lang/rust#151577 (Rename `DepKindStruct` to `DepKindVTable`)
 - rust-lang/rust#151620 (Fix 'the the' typo in library/core/src/array/iter.rs)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 27, 2026
compiler: Rename several types/traits for per-query vtables

- Follow-up to rust-lang#151577
---

This is another round of renaming for some subtle types and traits used by the query system, to hopefully make them easier to understand.

Key renames:
- struct `DynamicQuery` → `QueryVTable` (the actual vtable-like structure)
- struct `DynamicQueries` → `PerQueryVTables` (holds a vtable for each query)
- trait `QueryConfig` → `QueryDispatcher`
  - (used by generic functions in `rustc_query_system` to interact with query vtables)
- struct `DynamicConfig` → `SemiDynamicQueryDispatcher`
  - (implements `QueryDispatcher` by combining a vtable with some compile-time boolean flags for improved perf)
- trait `QueryConfigRestored` → `UnerasedQueryDispatcher`
  - (provides a `QueryDispatcher` while also remembering the query's unerased value type; allows some per-query code to be moved out of macros and into generic functions)

This was trickier than `DepKindVTable`, because there are more types and traits involved, and it's harder to come up with distinctive and useful names for all of them.

There should be no change to compiler behaviour.

r? Kivooeo (or compiler)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 27, 2026
compiler: Rename several types/traits for per-query vtables

- Follow-up to rust-lang#151577
---

This is another round of renaming for some subtle types and traits used by the query system, to hopefully make them easier to understand.

Key renames:
- struct `DynamicQuery` → `QueryVTable` (the actual vtable-like structure)
- struct `DynamicQueries` → `PerQueryVTables` (holds a vtable for each query)
- trait `QueryConfig` → `QueryDispatcher`
  - (used by generic functions in `rustc_query_system` to interact with query vtables)
- struct `DynamicConfig` → `SemiDynamicQueryDispatcher`
  - (implements `QueryDispatcher` by combining a vtable with some compile-time boolean flags for improved perf)
- trait `QueryConfigRestored` → `UnerasedQueryDispatcher`
  - (provides a `QueryDispatcher` while also remembering the query's unerased value type; allows some per-query code to be moved out of macros and into generic functions)

This was trickier than `DepKindVTable`, because there are more types and traits involved, and it's harder to come up with distinctive and useful names for all of them.

There should be no change to compiler behaviour.

r? Kivooeo (or compiler)
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jan 27, 2026
compiler: Rename several types/traits for per-query vtables

- Follow-up to rust-lang#151577
---

This is another round of renaming for some subtle types and traits used by the query system, to hopefully make them easier to understand.

Key renames:
- struct `DynamicQuery` → `QueryVTable` (the actual vtable-like structure)
- struct `DynamicQueries` → `PerQueryVTables` (holds a vtable for each query)
- trait `QueryConfig` → `QueryDispatcher`
  - (used by generic functions in `rustc_query_system` to interact with query vtables)
- struct `DynamicConfig` → `SemiDynamicQueryDispatcher`
  - (implements `QueryDispatcher` by combining a vtable with some compile-time boolean flags for improved perf)
- trait `QueryConfigRestored` → `UnerasedQueryDispatcher`
  - (provides a `QueryDispatcher` while also remembering the query's unerased value type; allows some per-query code to be moved out of macros and into generic functions)

This was trickier than `DepKindVTable`, because there are more types and traits involved, and it's harder to come up with distinctive and useful names for all of them.

There should be no change to compiler behaviour.

r? Kivooeo (or compiler)
Zalathar added a commit to Zalathar/rust that referenced this pull request Jan 28, 2026
compiler: Rename several types/traits for per-query vtables

- Follow-up to rust-lang#151577
---

This is another round of renaming for some subtle types and traits used by the query system, to hopefully make them easier to understand.

Key renames:
- struct `DynamicQuery` → `QueryVTable` (the actual vtable-like structure)
- struct `DynamicQueries` → `PerQueryVTables` (holds a vtable for each query)
- trait `QueryConfig` → `QueryDispatcher`
  - (used by generic functions in `rustc_query_system` to interact with query vtables)
- struct `DynamicConfig` → `SemiDynamicQueryDispatcher`
  - (implements `QueryDispatcher` by combining a vtable with some compile-time boolean flags for improved perf)
- trait `QueryConfigRestored` → `UnerasedQueryDispatcher`
  - (provides a `QueryDispatcher` while also remembering the query's unerased value type; allows some per-query code to be moved out of macros and into generic functions)

This was trickier than `DepKindVTable`, because there are more types and traits involved, and it's harder to come up with distinctive and useful names for all of them.

There should be no change to compiler behaviour.

r? Kivooeo (or compiler)
rust-timer added a commit that referenced this pull request Jan 28, 2026
Rollup merge of #151666 - Zalathar:query-vtable, r=Kivooeo

compiler: Rename several types/traits for per-query vtables

- Follow-up to #151577
---

This is another round of renaming for some subtle types and traits used by the query system, to hopefully make them easier to understand.

Key renames:
- struct `DynamicQuery` → `QueryVTable` (the actual vtable-like structure)
- struct `DynamicQueries` → `PerQueryVTables` (holds a vtable for each query)
- trait `QueryConfig` → `QueryDispatcher`
  - (used by generic functions in `rustc_query_system` to interact with query vtables)
- struct `DynamicConfig` → `SemiDynamicQueryDispatcher`
  - (implements `QueryDispatcher` by combining a vtable with some compile-time boolean flags for improved perf)
- trait `QueryConfigRestored` → `UnerasedQueryDispatcher`
  - (provides a `QueryDispatcher` while also remembering the query's unerased value type; allows some per-query code to be moved out of macros and into generic functions)

This was trickier than `DepKindVTable`, because there are more types and traits involved, and it's harder to come up with distinctive and useful names for all of them.

There should be no change to compiler behaviour.

r? Kivooeo (or compiler)
@zetanumbers
Copy link
Contributor

I would prefer these renaming PRs to be batched before merging into main.

@Zalathar
Copy link
Member Author

I would prefer these renaming PRs to be batched before merging into main.

I'm not sure what you mean by this.

All of my recent query-system rename PRs have been logically distinct. If I had combined them, they would be harder to review, they would be more prone to conflict and harder to rebase, and none of them would have landed yet.

@zetanumbers
Copy link
Contributor

zetanumbers commented Jan 29, 2026

These PRs break other query system PRs. Merging them too rapidly breaks other PRs rapidly too, which is quite distracting.

@petrochenkov
Copy link
Contributor

These PRs break other query system PRs. Merging them too rapidly breaks other PRs rapidly too, which is quite distracting.

The general process is that people work on their own PRs without concern about conflicts with other PRs (with rare exceptions), because a rebase is usually a trivial 5 minute task, especially over renaming changes.
As both a reviewer and an author I'd very much prefer the current approach to any kind of batching.

@Kivooeo
Copy link
Member

Kivooeo commented Jan 29, 2026

as a reviewer im very much prefer the current approach too

@zetanumbers
Copy link
Contributor

zetanumbers commented Jan 29, 2026

Well I get a notification whenever (AFAIK) first PR conflict with main happens. As who implements those PRs I value tracking PR conflicts because those could mean I have to redo major parts of my code. If I wouldn't handle these then I might have to waste reviewer's precious time by having irrelevant changes stick. AFAIK query system got a single overwhelmed reviewer, so I would really like to track those conflicts. Just a suggestion.

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