From 938e80781651c97d42859c91dbef337faae9ddd2 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Sun, 30 Apr 2023 19:34:13 +0000 Subject: [PATCH] Only cache typeck results if it's the typeck root --- compiler/rustc_middle/src/query/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index 6443c30e82291..111993ec7a880 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) }