Only cache typeck results if it's the typeck root

This commit is contained in:
Michael Goulet 2023-04-30 19:34:13 +00:00
parent 831c9298c8
commit 938e807816

View file

@ -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) }