Skip to content

Commit b726204

Browse files
incr.comp.: Cache type_of and some other queries.
1 parent 8ff449d commit b726204

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

src/librustc/ty/maps/config.rs

+3
Original file line numberDiff line numberDiff line change
@@ -662,3 +662,6 @@ impl_disk_cacheable_query!(mir_const_qualif, |def_id| def_id.is_local());
662662
impl_disk_cacheable_query!(check_match, |def_id| def_id.is_local());
663663
impl_disk_cacheable_query!(contains_extern_indicator, |_| true);
664664
impl_disk_cacheable_query!(def_symbol_name, |_| true);
665+
impl_disk_cacheable_query!(type_of, |def_id| def_id.is_local());
666+
impl_disk_cacheable_query!(predicates_of, |def_id| def_id.is_local());
667+
impl_disk_cacheable_query!(used_trait_imports, |def_id| def_id.is_local());

src/librustc/ty/maps/on_disk_cache.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,11 @@ impl<'sess> OnDiskCache<'sess> {
204204
let enc = &mut encoder;
205205
let qri = &mut query_result_index;
206206

207-
// Encode TypeckTables
207+
encode_query_results::<type_of, _>(tcx, enc, qri)?;
208+
encode_query_results::<predicates_of, _>(tcx, enc, qri)?;
209+
encode_query_results::<used_trait_imports, _>(tcx, enc, qri)?;
208210
encode_query_results::<typeck_tables_of, _>(tcx, enc, qri)?;
211+
encode_query_results::<trans_fulfill_obligation, _>(tcx, enc, qri)?;
209212
encode_query_results::<optimized_mir, _>(tcx, enc, qri)?;
210213
encode_query_results::<unsafety_check_result, _>(tcx, enc, qri)?;
211214
encode_query_results::<borrowck, _>(tcx, enc, qri)?;
@@ -215,7 +218,6 @@ impl<'sess> OnDiskCache<'sess> {
215218
encode_query_results::<const_is_rvalue_promotable_to_static, _>(tcx, enc, qri)?;
216219
encode_query_results::<contains_extern_indicator, _>(tcx, enc, qri)?;
217220
encode_query_results::<symbol_name, _>(tcx, enc, qri)?;
218-
encode_query_results::<trans_fulfill_obligation, _>(tcx, enc, qri)?;
219221
encode_query_results::<check_match, _>(tcx, enc, qri)?;
220222
}
221223

src/librustc/ty/maps/plumbing.rs

+3
Original file line numberDiff line numberDiff line change
@@ -982,4 +982,7 @@ impl_load_from_cache!(
982982
ConstIsRvaluePromotableToStatic => const_is_rvalue_promotable_to_static,
983983
ContainsExternIndicator => contains_extern_indicator,
984984
CheckMatch => check_match,
985+
TypeOfItem => type_of,
986+
PredicatesOfItem => predicates_of,
987+
UsedTraitImports => used_trait_imports,
985988
);

0 commit comments

Comments
 (0)