diff options
| author | bors <bors@rust-lang.org> | 2021-10-23 09:21:45 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-10-23 09:21:45 +0000 |
| commit | 55ccbd090d96ec3bb28dbcb383e65bbfa3c293ff (patch) | |
| tree | 9a97e775c5365ea41ae057987d3658199b922a0b /compiler/rustc_query_impl | |
| parent | cf708558b758f4473c4f35986d9492ace7bf906d (diff) | |
| parent | 0a5666b838c903caf672a05b3b4156cafb03cb3f (diff) | |
| download | rust-55ccbd090d96ec3bb28dbcb383e65bbfa3c293ff.tar.gz rust-55ccbd090d96ec3bb28dbcb383e65bbfa3c293ff.zip | |
Auto merge of #90065 - cjgillot:novalcache, r=Mark-Simulacrum
Do not depend on the stored value when trying to cache on disk. Having different criteria for loading and saving of query results can lead to saved results that may never be loaded. Since the on-disk cache is discarded as soon as a compilation error is issued, there should not be any need for an exclusion mecanism based on errors. As a result, the possibility to condition the storage on the value itself does not appear useful.
Diffstat (limited to 'compiler/rustc_query_impl')
| -rw-r--r-- | compiler/rustc_query_impl/src/on_disk_cache.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_query_impl/src/plumbing.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_query_impl/src/on_disk_cache.rs b/compiler/rustc_query_impl/src/on_disk_cache.rs index 86b12b3586a..7678c86596b 100644 --- a/compiler/rustc_query_impl/src/on_disk_cache.rs +++ b/compiler/rustc_query_impl/src/on_disk_cache.rs @@ -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. diff --git a/compiler/rustc_query_impl/src/plumbing.rs b/compiler/rustc_query_impl/src/plumbing.rs index 8c3fbb2071c..a822ef14778 100644 --- a/compiler/rustc_query_impl/src/plumbing.rs +++ b/compiler/rustc_query_impl/src/plumbing.rs @@ -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); } } |
