Re-allow computing fed queries.
This commit is contained in:
parent
791a7f22e3
commit
4224b4b1f5
1 changed files with 20 additions and 3 deletions
|
@ -410,10 +410,27 @@ where
|
||||||
// as its feeding query had. So if the fed query is red, so is its feeder, which will
|
// as its feeding query had. So if the fed query is red, so is its feeder, which will
|
||||||
// get evaluated first, and re-feed the query.
|
// get evaluated first, and re-feed the query.
|
||||||
if let Some((cached_result, _)) = cache.lookup(&key) {
|
if let Some((cached_result, _)) = cache.lookup(&key) {
|
||||||
|
let Some(hasher) = query.hash_result() else {
|
||||||
panic!(
|
panic!(
|
||||||
"fed query later has its value computed. The already cached value: {}",
|
"fed query later has its value computed. The already cached value: {}",
|
||||||
(query.format_value())(&cached_result)
|
(query.format_value())(&cached_result)
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
let (old_hash, new_hash) = qcx.dep_context().with_stable_hashing_context(|mut hcx| {
|
||||||
|
(hasher(&mut hcx, &cached_result), hasher(&mut hcx, &result))
|
||||||
|
});
|
||||||
|
let formatter = query.format_value();
|
||||||
|
debug_assert_eq!(
|
||||||
|
old_hash,
|
||||||
|
new_hash,
|
||||||
|
"Computed query value for {:?}({:?}) is inconsistent with fed value,\n\
|
||||||
|
computed={:#?}\nfed={:#?}",
|
||||||
|
query.dep_kind(),
|
||||||
|
key,
|
||||||
|
formatter(&result),
|
||||||
|
formatter(&cached_result),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
job_owner.complete(cache, result, dep_node_index);
|
job_owner.complete(cache, result, dep_node_index);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue