From 00ce6dc7187a1d572c19d3939fa5876ea6bbcbb1 Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Thu, 16 Dec 2021 18:32:00 -0500 Subject: [PATCH] Only cache local adt_def results on disk An `AdtDef` contains `Span`s, and we don't appear to actually encode the `SourceFile` for foreign spans in the incremental cache in some cases. --- 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 2a3b50c79bb..22caff1e8d9 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -522,7 +522,7 @@ rustc_queries! { } query adt_def(key: DefId) -> &'tcx ty::AdtDef { desc { |tcx| "computing ADT definition for `{}`", tcx.def_path_str(key) } - cache_on_disk_if { true } + cache_on_disk_if { key.is_local() } separate_provide_extern } query adt_destructor(key: DefId) -> Option {