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;
use rustc_data_structures::thin_vec::ThinVec;
use rustc_errors::Diagnostic;
-use rustc_hir::def_id::{DefPathHash, LocalDefId};
+use rustc_hir::def_id::LocalDefId;
mod dep_node;
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(());
}
op(icx.task_deps)
})
}
-
- fn can_reconstruct_query_key(&self) -> bool {
- DepKind::can_reconstruct_query_key(self)
- }
}
impl<'tcx> DepContext for TyCtxt<'tcx> {
type DepKind = DepKind;
type StableHashingContext = StableHashingContext<'tcx>;
- fn register_reused_dep_path_hash(&self, hash: DefPathHash) {
+ fn register_reused_dep_node(&self, dep_node: &DepNode) {
if let Some(cache) = self.queries.on_disk_cache.as_ref() {
- cache.register_reused_dep_path_hash(*self, hash)
+ cache.register_reused_dep_node(*self, dep_node)
}
}
// 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<Diagnostic> {