pub const FOREVER_RED_NODE: DepNodeIndex = DepNodeIndex::from_u32(1);
}
-impl std::convert::From<DepNodeIndex> for QueryInvocationId {
+impl From<DepNodeIndex> for QueryInvocationId {
#[inline]
fn from(dep_node_index: DepNodeIndex) -> Self {
QueryInvocationId(dep_node_index.as_u32())
cx: Ctxt,
key: A,
result: &R,
- hash_result: fn(&mut StableHashingContext<'_>, &R) -> Fingerprint,
+ hash_result: Option<fn(&mut StableHashingContext<'_>, &R) -> Fingerprint>,
) -> DepNodeIndex {
if let Some(data) = self.data.as_ref() {
// The caller query has more dependencies than the node we are creating. We may
// For sanity, we still check that the loaded stable hash and the new one match.
if let Some(dep_node_index) = self.dep_node_index_of_opt(&node) {
let _current_fingerprint =
- crate::query::incremental_verify_ich(cx, result, &node, Some(hash_result));
+ crate::query::incremental_verify_ich(cx, result, &node, hash_result);
#[cfg(debug_assertions)]
- data.current.record_edge(dep_node_index, node, _current_fingerprint);
+ if hash_result.is_some() {
+ data.current.record_edge(dep_node_index, node, _current_fingerprint);
+ }
return dep_node_index;
}
});
let hashing_timer = cx.profiler().incr_result_hashing();
- let current_fingerprint =
- cx.with_stable_hashing_context(|mut hcx| hash_result(&mut hcx, result));
+ let current_fingerprint = hash_result.map(|hash_result| {
+ cx.with_stable_hashing_context(|mut hcx| hash_result(&mut hcx, result))
+ });
let print_status = cfg!(debug_assertions) && cx.sess().opts.unstable_opts.dep_tasks;
&data.previous,
node,
edges,
- Some(current_fingerprint),
+ current_fingerprint,
print_status,
);