about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-04-30 19:34:13 +0000
committerMichael Goulet <michael@errs.io>2023-04-30 19:36:59 +0000
commit938e80781651c97d42859c91dbef337faae9ddd2 (patch)
tree0c9304b399d965e4398ffc86b3e86e7295dac798
parent831c9298c8e6542e3ab395216e98aec21f60b470 (diff)
downloadrust-938e80781651c97d42859c91dbef337faae9ddd2.tar.gz
rust-938e80781651c97d42859c91dbef337faae9ddd2.zip
Only cache typeck results if it's the typeck root
-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) }