diff --git a/compiler/rustc_middle/src/dep_graph/dep_node.rs b/compiler/rustc_middle/src/dep_graph/dep_node.rs index 2a9d6b00db1..fa96b800928 100644 --- a/compiler/rustc_middle/src/dep_graph/dep_node.rs +++ b/compiler/rustc_middle/src/dep_graph/dep_node.rs @@ -308,8 +308,23 @@ fn has_label_string(label: &str) -> bool { } } +impl<'tcx> DepNodeParams> for () { + #[inline(always)] + fn can_reconstruct_query_key() -> bool { + true + } + + fn to_fingerprint(&self, _: TyCtxt<'tcx>) -> Fingerprint { + Fingerprint::ZERO + } + + fn recover(_: TyCtxt<'tcx>, _: &DepNode) -> Option { + Some(()) + } +} + impl<'tcx> DepNodeParams> for DefId { - #[inline] + #[inline(always)] fn can_reconstruct_query_key() -> bool { true } @@ -338,7 +353,7 @@ fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option { } impl<'tcx> DepNodeParams> for LocalDefId { - #[inline] + #[inline(always)] fn can_reconstruct_query_key() -> bool { true } @@ -357,7 +372,7 @@ fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option { } impl<'tcx> DepNodeParams> for CrateNum { - #[inline] + #[inline(always)] fn can_reconstruct_query_key() -> bool { true } @@ -377,7 +392,7 @@ fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option { } impl<'tcx> DepNodeParams> for (DefId, DefId) { - #[inline] + #[inline(always)] fn can_reconstruct_query_key() -> bool { false } @@ -402,7 +417,7 @@ fn to_debug_str(&self, tcx: TyCtxt<'tcx>) -> String { } impl<'tcx> DepNodeParams> for HirId { - #[inline] + #[inline(always)] fn can_reconstruct_query_key() -> bool { false } diff --git a/compiler/rustc_query_system/src/dep_graph/dep_node.rs b/compiler/rustc_query_system/src/dep_graph/dep_node.rs index ff52fdab19c..64aba870502 100644 --- a/compiler/rustc_query_system/src/dep_graph/dep_node.rs +++ b/compiler/rustc_query_system/src/dep_graph/dep_node.rs @@ -153,12 +153,6 @@ impl DepNodeParams for T } } -impl DepNodeParams for () { - fn to_fingerprint(&self, _: Ctxt) -> Fingerprint { - Fingerprint::ZERO - } -} - /// A "work product" corresponds to a `.o` (or other) file that we /// save in between runs. These IDs do not have a `DefId` but rather /// some independent path or string that persists between runs without