From 70fba904121c6758e2874176e64db5a68ca14686 Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Wed, 15 Dec 2021 17:01:09 -0500 Subject: [PATCH] Cache adt_def query result on disk --- compiler/rustc_middle/src/query/mod.rs | 1 + compiler/rustc_middle/src/ty/codec.rs | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index 58f584d65d58..2a3b50c79bba 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -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 { diff --git a/compiler/rustc_middle/src/ty/codec.rs b/compiler/rustc_middle/src/ty/codec.rs index 2032f32ed8c2..3a8a3c0b1649 100644 --- a/compiler/rustc_middle/src/ty/codec.rs +++ b/compiler/rustc_middle/src/ty/codec.rs @@ -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 + &'tcx ty::List, + &'tcx ty::AdtDef } #[macro_export]