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.
This commit is contained in:
Aaron Hill 2021-12-16 18:32:00 -05:00
parent 70fba90412
commit 00ce6dc718
No known key found for this signature in database
GPG key ID: B4087E510E98B164

View file

@ -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<ty::Destructor> {