@@ -617,8 +617,8 @@ impl<'tcx> QueryDescription<'tcx> for queries::optimized_mir<'tcx> {
617
617
}
618
618
619
619
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 > {
622
622
let mir: Option < :: mir:: Mir < ' tcx > > = tcx. on_disk_query_result_cache
623
623
. try_load_query_result ( tcx, id) ;
624
624
mir. map ( |x| tcx. alloc_mir ( x) )
@@ -637,6 +637,21 @@ impl<'tcx> QueryDescription<'tcx> for queries::target_features_whitelist<'tcx> {
637
637
}
638
638
}
639
639
640
+ impl < ' tcx > QueryDescription < ' tcx > for queries:: generics_of < ' tcx > {
641
+ #[ inline]
642
+ fn cache_on_disk ( def_id : Self :: Key ) -> bool {
643
+ def_id. is_local ( )
644
+ }
645
+
646
+ fn try_load_from_disk < ' a > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
647
+ id : SerializedDepNodeIndex )
648
+ -> Option < Self :: Value > {
649
+ let generics: Option < ty:: Generics > = tcx. on_disk_query_result_cache
650
+ . try_load_query_result ( tcx, id) ;
651
+ generics. map ( |x| tcx. alloc_generics ( x) )
652
+ }
653
+ }
654
+
640
655
macro_rules! impl_disk_cacheable_query(
641
656
( $query_name: ident, |$key: tt| $cond: expr) => {
642
657
impl <' tcx> QueryDescription <' tcx> for queries:: $query_name<' tcx> {
0 commit comments