@@ -31,9 +31,9 @@ pub(super) trait QueryDescription<'tcx>: QueryConfig {
3131 false
3232 }
3333
34- fn load_from_disk < ' a > ( _: TyCtxt < ' a , ' tcx , ' tcx > ,
35- _: SerializedDepNodeIndex )
36- -> Self :: Value {
34+ fn try_load_from_disk < ' a > ( _: TyCtxt < ' a , ' tcx , ' tcx > ,
35+ _: SerializedDepNodeIndex )
36+ -> Option < Self :: Value > {
3737 bug ! ( "QueryDescription::load_from_disk() called for unsupport query." )
3838 }
3939}
@@ -556,12 +556,14 @@ impl<'tcx> QueryDescription<'tcx> for queries::typeck_tables_of<'tcx> {
556556 def_id. is_local ( )
557557 }
558558
559- fn load_from_disk < ' a > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
560- id : SerializedDepNodeIndex )
561- -> Self :: Value {
562- let typeck_tables: ty:: TypeckTables < ' tcx > = tcx. on_disk_query_result_cache
563- . load_query_result ( tcx, id) ;
564- tcx. alloc_tables ( typeck_tables)
559+ fn try_load_from_disk < ' a > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
560+ id : SerializedDepNodeIndex )
561+ -> Option < Self :: Value > {
562+ let typeck_tables: Option < ty:: TypeckTables < ' tcx > > = tcx
563+ . on_disk_query_result_cache
564+ . try_load_query_result ( tcx, id) ;
565+
566+ typeck_tables. map ( |tables| tcx. alloc_tables ( tables) )
565567 }
566568}
567569
0 commit comments