@@ -617,8 +617,8 @@ impl<'tcx> QueryDescription<'tcx> for queries::optimized_mir<'tcx> {
617617 }
618618
619619 fn try_load_from_disk < ' a > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
620- id : SerializedDepNodeIndex )
621- -> Option < Self :: Value > {
620+ id : SerializedDepNodeIndex )
621+ -> Option < Self :: Value > {
622622 let mir: Option < :: mir:: Mir < ' tcx > > = tcx. on_disk_query_result_cache
623623 . try_load_query_result ( tcx, id) ;
624624 mir. map ( |x| tcx. alloc_mir ( x) )
@@ -643,6 +643,21 @@ impl<'tcx> QueryDescription<'tcx> for queries::instance_def_size_estimate<'tcx>
643643 }
644644}
645645
646+ impl < ' tcx > QueryDescription < ' tcx > for queries:: generics_of < ' tcx > {
647+ #[ inline]
648+ fn cache_on_disk ( def_id : Self :: Key ) -> bool {
649+ def_id. is_local ( )
650+ }
651+
652+ fn try_load_from_disk < ' a > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
653+ id : SerializedDepNodeIndex )
654+ -> Option < Self :: Value > {
655+ let generics: Option < ty:: Generics > = tcx. on_disk_query_result_cache
656+ . try_load_query_result ( tcx, id) ;
657+ generics. map ( |x| tcx. alloc_generics ( x) )
658+ }
659+ }
660+
646661macro_rules! impl_disk_cacheable_query(
647662 ( $query_name: ident, |$key: tt| $cond: expr) => {
648663 impl <' tcx> QueryDescription <' tcx> for queries:: $query_name<' tcx> {
@@ -668,3 +683,6 @@ impl_disk_cacheable_query!(mir_const_qualif, |def_id| def_id.is_local());
668683impl_disk_cacheable_query ! ( check_match, |def_id| def_id. is_local( ) ) ;
669684impl_disk_cacheable_query ! ( contains_extern_indicator, |_| true ) ;
670685impl_disk_cacheable_query ! ( def_symbol_name, |_| true ) ;
686+ impl_disk_cacheable_query ! ( type_of, |def_id| def_id. is_local( ) ) ;
687+ impl_disk_cacheable_query ! ( predicates_of, |def_id| def_id. is_local( ) ) ;
688+ impl_disk_cacheable_query ! ( used_trait_imports, |def_id| def_id. is_local( ) ) ;
0 commit comments