Skip to content

Commit 70fba90

Browse files
committed
Cache adt_def query result on disk
1 parent f5f9054 commit 70fba90

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Diff for: compiler/rustc_middle/src/query/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ rustc_queries! {
522522
}
523523
query adt_def(key: DefId) -> &'tcx ty::AdtDef {
524524
desc { |tcx| "computing ADT definition for `{}`", tcx.def_path_str(key) }
525+
cache_on_disk_if { true }
525526
separate_provide_extern
526527
}
527528
query adt_destructor(key: DefId) -> Option<ty::Destructor> {

Diff for: compiler/rustc_middle/src/ty/codec.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ encodable_via_deref! {
155155
&'tcx mir::Body<'tcx>,
156156
&'tcx mir::UnsafetyCheckResult,
157157
&'tcx mir::BorrowCheckResult<'tcx>,
158-
&'tcx mir::coverage::CodeRegion
158+
&'tcx mir::coverage::CodeRegion,
159+
&'tcx ty::AdtDef
159160
}
160161

161162
pub trait TyDecoder<'tcx>: Decoder {
@@ -391,7 +392,8 @@ impl_decodable_via_ref! {
391392
&'tcx mir::UnsafetyCheckResult,
392393
&'tcx mir::BorrowCheckResult<'tcx>,
393394
&'tcx mir::coverage::CodeRegion,
394-
&'tcx ty::List<ty::BoundVariableKind>
395+
&'tcx ty::List<ty::BoundVariableKind>,
396+
&'tcx ty::AdtDef
395397
}
396398

397399
#[macro_export]

0 commit comments

Comments
 (0)