diff options
| author | bors <bors@rust-lang.org> | 2023-05-01 06:58:49 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-05-01 06:58:49 +0000 |
| commit | 4b87ed9d0f18166a26aadb5289bac004e058b90f (patch) | |
| tree | 95b0bc372491a2397aa094cfd88cfff5cd3bd38e | |
| parent | 2034b6d23ca18311a23273f2f08c381a04fa05d9 (diff) | |
| parent | 938e80781651c97d42859c91dbef337faae9ddd2 (diff) | |
| download | rust-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.rs | 2 |
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) } |
