Skip to content

Rename trait DepNodeParams to DepNodeKey#152033

Merged
rust-bors[bot] merged 4 commits intorust-lang:mainfrom
Zalathar:dep-node-key
Feb 5, 2026
Merged

Rename trait DepNodeParams to DepNodeKey#152033
rust-bors[bot] merged 4 commits intorust-lang:mainfrom
Zalathar:dep-node-key

Conversation

@Zalathar
Copy link
Member

@Zalathar Zalathar commented Feb 3, 2026

In query system plumbing, we usually refer to a query's explicit argument value as a “key”.

The first few commits do some preliminary cleanup that would conflict with the rename; the rename itself is in the final commit.

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 Feb 3, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Feb 4, 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.

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.

Good renaming. I especially like how Key is singular, which matches reality.

One question about the to_fingerprint default.

View changes since this review

pub trait DepNodeKey<Tcx: DepContext>: fmt::Debug + Sized {
fn fingerprint_style() -> FingerprintStyle;

/// This method turns the parameters of a DepNodeConstructor into an opaque
Copy link
Contributor

Choose a reason for hiding this comment

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

Heh, DepNodeConstructor no longer exists

///
/// Not all `DepNodeKey` impls support being turned into a `Fingerprint`
/// (they don't need to if the corresponding `DepNode` is anonymous).
fn to_fingerprint(&self, _: Tcx) -> Fingerprint {
Copy link
Contributor

Choose a reason for hiding this comment

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

How does this default method interact with the default to_finger_print method in the blanket impl below? Seems like we have two defaults, and I honestly don't know how this is treated.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure either.

The blanket impl also has a HashStable bound, so maybe the trait-default is used for explicit impls on types that aren't HashStable?

I also noticed that removing the default body from the trait doesn't seem to cause any compile errors, so maybe it's not being used?

Copy link
Contributor

@nnethercote nnethercote Feb 4, 2026

Choose a reason for hiding this comment

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

The output of this program is default 2.

![allow(incomplete_features)]
#![feature(specialization)]

trait Blah {
    fn f() {
        eprintln!("default 1");
    }
}

impl<T> Blah for T {
    default fn f() {
        eprintln!("default 2");
    }
}

fn main() {
    u32::f();
}

I think you can remove the panicking default in the trait definition.

Copy link
Member Author

Choose a reason for hiding this comment

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

Normally I try to refrain from “functional” changes in renaming PRs (to make review and archaology easier), but this seems innocent enough, and if we're right then it doesn't change any actual behaviour.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think commit boundaries are more important than PR boundaries for this kind of thing. So we are good here.

There don't appear to be any trait impls relying on this default body.
@nnethercote
Copy link
Contributor

@bors r+

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 4, 2026

📌 Commit b902f89 has been approved by nnethercote

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 4, 2026
Zalathar added a commit to Zalathar/rust that referenced this pull request Feb 5, 2026
Rename trait `DepNodeParams` to `DepNodeKey`

In query system plumbing, we usually refer to a query's explicit argument value as a “key”.

The first few commits do some preliminary cleanup that would conflict with the rename; the rename itself is in the final commit.

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

Successful merges:

 - #151431 (Add new unstable attribute: `#[export_visibility = ...]`.)
 - #146900 (Add avr_target_feature)
 - #152033 (Rename trait `DepNodeParams` to `DepNodeKey`)
 - #152142 (Convert to inline diagnostics in `rustc_hir_typeck`)
 - #152020 (Remove dummy loads on offload codegen)
 - #152023 (Some `rustc_query_system` cleanups)
 - #152068 (Convert to inline diagnostics in `rustc_resolve`)
 - #152081 (Port depgraph testing attributes to parser)
 - #152090 (Port reexport_test_harness_main to attr parser)
 - #152105 (Convert to inline diagnostics in `rustc_ast_lowering`)
 - #152108 (Convert to inline diagnostics in `rustc_expand`)
 - #152114 (Convert to inline diagnostics in `rustc_mir_transform`)
 - #152115 (Convert to inline diagnostics in `rustc_metadata`)
 - #152116 (Remove rustdoc GUI flaky test)
 - #152128 (Adopt matches-logical-or-141497.rs to LLVM HEAD)

Failed merges:

 - #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`)
 - #152117 (Convert to inline diagnostics in `rustc_trait_selection`)
 - #152118 (Convert to inline diagnostics in `rustc_codegen_ssa`)
 - #152119 (Convert to inline diagnostics in `rustc_middle`)
 - #152126 (Convert to inline diagnostics in `rustc_mir_build`)
 - #152131 (Port rustc_no_implicit_bounds attribute to parser.)
Zalathar added a commit to Zalathar/rust that referenced this pull request Feb 5, 2026
Rename trait `DepNodeParams` to `DepNodeKey`

In query system plumbing, we usually refer to a query's explicit argument value as a “key”.

The first few commits do some preliminary cleanup that would conflict with the rename; the rename itself is in the final commit.

r? nnethercote (or compiler)
Zalathar added a commit to Zalathar/rust that referenced this pull request Feb 5, 2026
Rename trait `DepNodeParams` to `DepNodeKey`

In query system plumbing, we usually refer to a query's explicit argument value as a “key”.

The first few commits do some preliminary cleanup that would conflict with the rename; the rename itself is in the final commit.

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

Successful merges:

 - #146900 (Add avr_target_feature)
 - #150379 (Return `ExitCode` from `rustc_driver::main` instead of calling `process::exit`)
 - #152033 (Rename trait `DepNodeParams` to `DepNodeKey`)
 - #152142 (Convert to inline diagnostics in `rustc_hir_typeck`)
 - #152145 (Disable flaky test `oneshot::recv_timeout_before_send`)
 - #152020 (Remove dummy loads on offload codegen)
 - #152023 (Some `rustc_query_system` cleanups)
 - #152068 (Convert to inline diagnostics in `rustc_resolve`)
 - #152081 (Port depgraph testing attributes to parser)
 - #152090 (Port reexport_test_harness_main to attr parser)
 - #152105 (Convert to inline diagnostics in `rustc_ast_lowering`)
 - #152108 (Convert to inline diagnostics in `rustc_expand`)
 - #152110 (Fix incorrect RSS on systems with non-4K page size)
 - #152111 (bootstrap: exclude hexagon-unknown-qurt from llvm-libunwind default)
 - #152114 (Convert to inline diagnostics in `rustc_mir_transform`)
 - #152115 (Convert to inline diagnostics in `rustc_metadata`)
 - #152116 (Remove rustdoc GUI flaky test)
 - #152118 (Convert to inline diagnostics in `rustc_codegen_ssa`)
 - #152128 (Adopt matches-logical-or-141497.rs to LLVM HEAD)

Failed merges:

 - #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`)
 - #152117 (Convert to inline diagnostics in `rustc_trait_selection`)
 - #152119 (Convert to inline diagnostics in `rustc_middle`)
 - #152126 (Convert to inline diagnostics in `rustc_mir_build`)
 - #152131 (Port rustc_no_implicit_bounds attribute to parser.)
rust-bors bot pushed a commit that referenced this pull request Feb 5, 2026
…uwer

Rollup of 18 pull requests

Successful merges:

 - #150379 (Return `ExitCode` from `rustc_driver::main` instead of calling `process::exit`)
 - #152033 (Rename trait `DepNodeParams` to `DepNodeKey`)
 - #152142 (Convert to inline diagnostics in `rustc_hir_typeck`)
 - #152145 (Disable flaky test `oneshot::recv_timeout_before_send`)
 - #152020 (Remove dummy loads on offload codegen)
 - #152023 (Some `rustc_query_system` cleanups)
 - #152068 (Convert to inline diagnostics in `rustc_resolve`)
 - #152081 (Port depgraph testing attributes to parser)
 - #152090 (Port reexport_test_harness_main to attr parser)
 - #152105 (Convert to inline diagnostics in `rustc_ast_lowering`)
 - #152108 (Convert to inline diagnostics in `rustc_expand`)
 - #152110 (Fix incorrect RSS on systems with non-4K page size)
 - #152111 (bootstrap: exclude hexagon-unknown-qurt from llvm-libunwind default)
 - #152114 (Convert to inline diagnostics in `rustc_mir_transform`)
 - #152115 (Convert to inline diagnostics in `rustc_metadata`)
 - #152116 (Remove rustdoc GUI flaky test)
 - #152118 (Convert to inline diagnostics in `rustc_codegen_ssa`)
 - #152128 (Adopt matches-logical-or-141497.rs to LLVM HEAD)

Failed merges:

 - #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`)
 - #152117 (Convert to inline diagnostics in `rustc_trait_selection`)
 - #152119 (Convert to inline diagnostics in `rustc_middle`)
 - #152126 (Convert to inline diagnostics in `rustc_mir_build`)
 - #152131 (Port rustc_no_implicit_bounds attribute to parser.)
@rust-bors rust-bors bot merged commit c5381dd into rust-lang:main Feb 5, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 5, 2026
@Zalathar Zalathar deleted the dep-node-key branch February 5, 2026 10:56
rust-timer added a commit that referenced this pull request Feb 5, 2026
Rollup merge of #152033 - Zalathar:dep-node-key, r=nnethercote

Rename trait `DepNodeParams` to `DepNodeKey`

In query system plumbing, we usually refer to a query's explicit argument value as a “key”.

The first few commits do some preliminary cleanup that would conflict with the rename; the rename itself is in the final commit.

r? nnethercote (or compiler)
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Feb 6, 2026
…uwer

Rollup of 18 pull requests

Successful merges:

 - rust-lang/rust#150379 (Return `ExitCode` from `rustc_driver::main` instead of calling `process::exit`)
 - rust-lang/rust#152033 (Rename trait `DepNodeParams` to `DepNodeKey`)
 - rust-lang/rust#152142 (Convert to inline diagnostics in `rustc_hir_typeck`)
 - rust-lang/rust#152145 (Disable flaky test `oneshot::recv_timeout_before_send`)
 - rust-lang/rust#152020 (Remove dummy loads on offload codegen)
 - rust-lang/rust#152023 (Some `rustc_query_system` cleanups)
 - rust-lang/rust#152068 (Convert to inline diagnostics in `rustc_resolve`)
 - rust-lang/rust#152081 (Port depgraph testing attributes to parser)
 - rust-lang/rust#152090 (Port reexport_test_harness_main to attr parser)
 - rust-lang/rust#152105 (Convert to inline diagnostics in `rustc_ast_lowering`)
 - rust-lang/rust#152108 (Convert to inline diagnostics in `rustc_expand`)
 - rust-lang/rust#152110 (Fix incorrect RSS on systems with non-4K page size)
 - rust-lang/rust#152111 (bootstrap: exclude hexagon-unknown-qurt from llvm-libunwind default)
 - rust-lang/rust#152114 (Convert to inline diagnostics in `rustc_mir_transform`)
 - rust-lang/rust#152115 (Convert to inline diagnostics in `rustc_metadata`)
 - rust-lang/rust#152116 (Remove rustdoc GUI flaky test)
 - rust-lang/rust#152118 (Convert to inline diagnostics in `rustc_codegen_ssa`)
 - rust-lang/rust#152128 (Adopt matches-logical-or-141497.rs to LLVM HEAD)

Failed merges:

 - rust-lang/rust#152070 (Convert to inline diagnostics in `rustc_pattern_analysis`)
 - rust-lang/rust#152106 (Convert to inline diagnostics in `rustc_ast_passes`)
 - rust-lang/rust#152109 (Convert to inline diagnostics in `rustc_errors`)
 - rust-lang/rust#152117 (Convert to inline diagnostics in `rustc_trait_selection`)
 - rust-lang/rust#152119 (Convert to inline diagnostics in `rustc_middle`)
 - rust-lang/rust#152126 (Convert to inline diagnostics in `rustc_mir_build`)
 - rust-lang/rust#152131 (Port rustc_no_implicit_bounds attribute to parser.)
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.

4 participants