Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit d1220fd

Browse files
committed
Simplify DepNodeParams.
1 parent 79a5762 commit d1220fd

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

compiler/rustc_middle/src/dep_graph/dep_node.rs

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,23 @@ impl DepNodeExt for DepNode {
308308
}
309309
}
310310

311+
impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for () {
312+
#[inline(always)]
313+
fn can_reconstruct_query_key() -> bool {
314+
true
315+
}
316+
317+
fn to_fingerprint(&self, _: TyCtxt<'tcx>) -> Fingerprint {
318+
Fingerprint::ZERO
319+
}
320+
321+
fn recover(_: TyCtxt<'tcx>, _: &DepNode) -> Option<Self> {
322+
Some(())
323+
}
324+
}
325+
311326
impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for DefId {
312-
#[inline]
327+
#[inline(always)]
313328
fn can_reconstruct_query_key() -> bool {
314329
true
315330
}
@@ -338,7 +353,7 @@ impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for DefId {
338353
}
339354

340355
impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for LocalDefId {
341-
#[inline]
356+
#[inline(always)]
342357
fn can_reconstruct_query_key() -> bool {
343358
true
344359
}
@@ -357,7 +372,7 @@ impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for LocalDefId {
357372
}
358373

359374
impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for CrateNum {
360-
#[inline]
375+
#[inline(always)]
361376
fn can_reconstruct_query_key() -> bool {
362377
true
363378
}
@@ -377,7 +392,7 @@ impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for CrateNum {
377392
}
378393

379394
impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for (DefId, DefId) {
380-
#[inline]
395+
#[inline(always)]
381396
fn can_reconstruct_query_key() -> bool {
382397
false
383398
}
@@ -402,7 +417,7 @@ impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for (DefId, DefId) {
402417
}
403418

404419
impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for HirId {
405-
#[inline]
420+
#[inline(always)]
406421
fn can_reconstruct_query_key() -> bool {
407422
false
408423
}

compiler/rustc_query_system/src/dep_graph/dep_node.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,6 @@ where
153153
}
154154
}
155155

156-
impl<Ctxt: DepContext> DepNodeParams<Ctxt> for () {
157-
fn to_fingerprint(&self, _: Ctxt) -> Fingerprint {
158-
Fingerprint::ZERO
159-
}
160-
}
161-
162156
/// A "work product" corresponds to a `.o` (or other) file that we
163157
/// save in between runs. These IDs do not have a `DefId` but rather
164158
/// some independent path or string that persists between runs without

0 commit comments

Comments
 (0)