1
Fork 0

Do not depend on the stored value when trying to cache on disk.

This commit is contained in:
Camille GILLOT 2021-10-19 20:15:13 +02:00
parent e015ef5b26
commit 0a5666b838
6 changed files with 12 additions and 25 deletions

View file

@ -1033,7 +1033,7 @@ where
if res.is_err() {
return;
}
if Q::cache_on_disk(tcx, &key, Some(value)) {
if Q::cache_on_disk(tcx, &key) {
let dep_node = SerializedDepNodeIndex::new(dep_node.index());
// Record position of the cache entry.

View file

@ -418,7 +418,7 @@ macro_rules! define_queries {
let key = recover(tcx, dep_node).unwrap_or_else(|| panic!("Failed to recover key for {:?} with hash {}", dep_node, dep_node.hash));
let tcx = QueryCtxt::from_tcx(tcx);
if queries::$name::cache_on_disk(tcx, &key, None) {
if queries::$name::cache_on_disk(tcx, &key) {
let _ = tcx.$name(key);
}
}