Skip to content

Conversation

@Zalathar
Copy link
Member

This PR simplifies parts of the query system, by removing the make_dep_kind_name_array! macro, and removing much of the associated plumbing added by 68fd771.

Instead, we now create a DEP_KIND_NAMES constant in define_dep_nodes!, and look up names in that instead.

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

rustbot commented Jan 20, 2026

r? @petrochenkov

rustbot has assigned @petrochenkov.
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
Member Author

Back in #115920 I see some mention of allowing other crates to define dep kinds, but I can’t find any indication of why that’s desirable, or whether anything ever came of it.

@Kobzol
Copy link
Member

Kobzol commented Jan 20, 2026

@bors try @rust-timer queue

Just to be sure :)

When working on derive proc-macro caching recently, I was quite confused by the depkind names are generated. Any simplifications are welcome 😁

@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 Jan 20, 2026
Simplify lookup of `DepKind` names in duplicate dep node check
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 20, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 20, 2026

☀️ Try build successful (CI)
Build commit: 7945977 (79459778fb94a22654c3b574dd5593e6e1a6c97e, parent: 79818181387879de7a521366d9bea23624728462)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (7945977): 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.4% [0.4%, 0.4%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 1.0%, secondary -5.6%)

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

mean range count
Regressions ❌
(primary)
2.6% [2.6%, 2.6%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.6% [-0.6%, -0.6%] 1
Improvements ✅
(secondary)
-5.6% [-5.6%, -5.6%] 1
All ❌✅ (primary) 1.0% [-0.6%, 2.6%] 2

Cycles

Results (primary 2.5%, secondary 4.4%)

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

mean range count
Regressions ❌
(primary)
2.5% [2.5%, 2.5%] 1
Regressions ❌
(secondary)
4.4% [3.2%, 5.5%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.5% [2.5%, 2.5%] 1

Binary size

Results (primary -0.0%, secondary -0.0%)

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)
- - 0
Improvements ✅
(primary)
-0.0% [-0.0%, -0.0%] 13
Improvements ✅
(secondary)
-0.0% [-0.1%, -0.0%] 6
All ❌✅ (primary) -0.0% [-0.0%, -0.0%] 13

Bootstrap: 473.092s -> 475.338s (0.47%)
Artifact size: 383.30 MiB -> 383.26 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 20, 2026
@petrochenkov
Copy link
Contributor

r=me after removing the Clone impl if possible.
@bors rollup=maybe
@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 Jan 20, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 21, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@Zalathar
Copy link
Member Author

Removed the unnecessary #[derive(Clone)] by giving DepGraph<D> a clone impl that doesn't naively require D: Clone.

@bors r=petrochenkov

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 21, 2026

📌 Commit 395ca3b has been approved by petrochenkov

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 21, 2026
rust-bors bot pushed a commit that referenced this pull request Jan 21, 2026
Rollup of 4 pull requests

Successful merges:

 - #148637 (Replace `#[rustc_do_not_implement_via_object]` with `#[rustc_dyn_incompatible_trait]`)
 - #149209 (Move LTO to OngoingCodegen::join)
 - #151402 (Simplify lookup of `DepKind` names in duplicate dep node check)
 - #151437 (Roll bootstrap reviewers for `src/tools/build-manifest`)

r? @ghost
@rust-bors rust-bors bot merged commit 9805475 into rust-lang:main Jan 21, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Jan 21, 2026
rust-timer added a commit that referenced this pull request Jan 21, 2026
Rollup merge of #151402 - dep-kind-name, r=petrochenkov

Simplify lookup of `DepKind` names in duplicate dep node check

This PR simplifies parts of the query system, by removing the `make_dep_kind_name_array!` macro, and removing much of the associated plumbing added by 68fd771.

Instead, we now create a `DEP_KIND_NAMES` constant in `define_dep_nodes!`, and look up names in that instead.
@Zalathar Zalathar deleted the dep-kind-name branch January 21, 2026 13:55
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