Skip to content

Commit 4b87ed9

Browse files
committed
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`
2 parents 2034b6d + 938e807 commit 4b87ed9

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_middle/src/query

1 file changed

+1
-1
lines changed

Diff for: compiler/rustc_middle/src/query/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ rustc_queries! {
875875

876876
query typeck(key: LocalDefId) -> &'tcx ty::TypeckResults<'tcx> {
877877
desc { |tcx| "type-checking `{}`", tcx.def_path_str(key) }
878-
cache_on_disk_if { true }
878+
cache_on_disk_if(tcx) { !tcx.is_typeck_child(key.to_def_id()) }
879879
}
880880
query diagnostic_only_typeck(key: LocalDefId) -> &'tcx ty::TypeckResults<'tcx> {
881881
desc { |tcx| "type-checking `{}`", tcx.def_path_str(key) }

0 commit comments

Comments
 (0)