]> git.lizzy.rs Git - rust.git/commitdiff
Simplify DepNodeParams.
authorCamille GILLOT <gillot.camille@gmail.com>
Tue, 27 Oct 2020 18:54:28 +0000 (19:54 +0100)
committerCamille GILLOT <gillot.camille@gmail.com>
Fri, 8 Jan 2021 16:29:49 +0000 (17:29 +0100)
compiler/rustc_middle/src/dep_graph/dep_node.rs
compiler/rustc_query_system/src/dep_graph/dep_node.rs

index 2a9d6b00db1135ce9a5dd41bb3556ca46806c661..fa96b800928ec85cd6d886004d790a7353ddd003 100644 (file)
@@ -308,8 +308,23 @@ fn has_label_string(label: &str) -> bool {
     }
 }
 
+impl<'tcx> DepNodeParams<TyCtxt<'tcx>> 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<Self> {
+        Some(())
+    }
+}
+
 impl<'tcx> DepNodeParams<TyCtxt<'tcx>> 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<Self> {
 }
 
 impl<'tcx> DepNodeParams<TyCtxt<'tcx>> 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<Self> {
 }
 
 impl<'tcx> DepNodeParams<TyCtxt<'tcx>> 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<Self> {
 }
 
 impl<'tcx> DepNodeParams<TyCtxt<'tcx>> 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<TyCtxt<'tcx>> for HirId {
-    #[inline]
+    #[inline(always)]
     fn can_reconstruct_query_key() -> bool {
         false
     }
index ff52fdab19c50775f25b8e763faa5aff2c8d4732..64aba870502c77453f7d24881b1edf8099533a65 100644 (file)
@@ -153,12 +153,6 @@ impl<Ctxt: DepContext, T> DepNodeParams<Ctxt> for T
     }
 }
 
-impl<Ctxt: DepContext> DepNodeParams<Ctxt> 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