1
Fork 0

Cache adt_def query result on disk

This commit is contained in:
Aaron Hill 2021-12-15 17:01:09 -05:00
parent f5f90540c9
commit 70fba90412
No known key found for this signature in database
GPG key ID: B4087E510E98B164
2 changed files with 5 additions and 2 deletions

View file

@ -522,6 +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 }
separate_provide_extern
}
query adt_destructor(key: DefId) -> Option<ty::Destructor> {

View file

@ -155,7 +155,8 @@ encodable_via_deref! {
&'tcx mir::Body<'tcx>,
&'tcx mir::UnsafetyCheckResult,
&'tcx mir::BorrowCheckResult<'tcx>,
&'tcx mir::coverage::CodeRegion
&'tcx mir::coverage::CodeRegion,
&'tcx ty::AdtDef
}
pub trait TyDecoder<'tcx>: Decoder {
@ -391,7 +392,8 @@ impl_decodable_via_ref! {
&'tcx mir::UnsafetyCheckResult,
&'tcx mir::BorrowCheckResult<'tcx>,
&'tcx mir::coverage::CodeRegion,
&'tcx ty::List<ty::BoundVariableKind>
&'tcx ty::List<ty::BoundVariableKind>,
&'tcx ty::AdtDef
}
#[macro_export]