Skip to content

Commit 938e807

Browse files
Only cache typeck results if it's the typeck root
1 parent 831c929 commit 938e807

File tree

1 file changed

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

1 file changed

+1
-1
lines changed

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)