about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-05-01 06:58:49 +0000
committerbors <bors@rust-lang.org>2023-05-01 06:58:49 +0000
commit4b87ed9d0f18166a26aadb5289bac004e058b90f (patch)
tree95b0bc372491a2397aa094cfd88cfff5cd3bd38e
parent2034b6d23ca18311a23273f2f08c381a04fa05d9 (diff)
parent938e80781651c97d42859c91dbef337faae9ddd2 (diff)
downloadrust-4b87ed9d0f18166a26aadb5289bac004e058b90f.tar.gz
rust-4b87ed9d0f18166a26aadb5289bac004e058b90f.zip
Auto merge of #111026 - compiler-errors:only-typeck-root, r=cjgillot
Only cache typeck results if it's the typeck root

context: https://rust-lang.zulipchat.com/#narrow/stream/241847-t-compiler.2Fwg-incr-comp/topic/incr_comp_query_cache_promotion.20taking.20forever

Basically, typeck children just copy the typeck results of their typeck root item, so caching their results means copying the same typeck results for each child item.

r? `@ghost`
-rw-r--r--compiler/rustc_middle/src/query/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs
index 6443c30e822..111993ec7a8 100644
--- a/compiler/rustc_middle/src/query/mod.rs
+++ b/compiler/rustc_middle/src/query/mod.rs
@@ -875,7 +875,7 @@ rustc_queries! {
 
     query typeck(key: LocalDefId) -> &'tcx ty::TypeckResults<'tcx> {
         desc { |tcx| "type-checking `{}`", tcx.def_path_str(key) }
-        cache_on_disk_if { true }
+        cache_on_disk_if(tcx) { !tcx.is_typeck_child(key.to_def_id()) }
     }
     query diagnostic_only_typeck(key: LocalDefId) -> &'tcx ty::TypeckResults<'tcx> {
         desc { |tcx| "type-checking `{}`", tcx.def_path_str(key) }