X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_middle%2Fsrc%2Fdep_graph%2Fmod.rs;h=88441af674d33c0f151ffa6266e1bb8581be19b8;hb=bee1fbb67e6409494986af8bc2ac3048b750f29a;hp=728bfef9f467373bf7cf712f62547afb819c20ea;hpb=299c2fc69554998e8991715d09a611376a5b9cf3;p=rust.git diff --git a/compiler/rustc_middle/src/dep_graph/mod.rs b/compiler/rustc_middle/src/dep_graph/mod.rs index 728bfef9f46..88441af674d 100644 --- a/compiler/rustc_middle/src/dep_graph/mod.rs +++ b/compiler/rustc_middle/src/dep_graph/mod.rs @@ -1,5 +1,4 @@ use crate::ich::StableHashingContext; -use crate::ty::query::try_load_from_on_disk_cache; use crate::ty::{self, TyCtxt}; use rustc_data_structures::profiling::SelfProfilerRef; use rustc_data_structures::sync::Lock; @@ -26,18 +25,25 @@ impl rustc_query_system::dep_graph::DepKind for DepKind { const NULL: Self = DepKind::Null; + #[inline(always)] + fn can_reconstruct_query_key(&self) -> bool { + DepKind::can_reconstruct_query_key(self) + } + + #[inline(always)] fn is_eval_always(&self) -> bool { - DepKind::is_eval_always(self) + self.is_eval_always } + #[inline(always)] fn has_params(&self) -> bool { - DepKind::has_params(self) + self.has_params } fn debug_node(node: &DepNode, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{:?}", node.kind)?; - if !node.kind.has_params() && !node.kind.is_anon() { + if !node.kind.has_params && !node.kind.is_anon { return Ok(()); } @@ -81,10 +87,6 @@ fn read_deps(op: OP) op(icx.task_deps) }) } - - fn can_reconstruct_query_key(&self) -> bool { - DepKind::can_reconstruct_query_key(self) - } } impl<'tcx> DepContext for TyCtxt<'tcx> { @@ -166,7 +168,7 @@ fn diagnostic(&self) -> &rustc_errors::Handler { // Interactions with on_disk_cache fn try_load_from_on_disk_cache(&self, dep_node: &DepNode) { - try_load_from_on_disk_cache(*self, dep_node) + (dep_node.kind.try_load_from_on_disk_cache)(*self, dep_node) } fn load_diagnostics(&self, prev_dep_node_index: SerializedDepNodeIndex) -> Vec {