@@ -12,7 +12,7 @@ use crate::session::{CrateDisambiguator, Session};
1212use crate :: ty;
1313use crate :: ty:: codec:: { self as ty_codec, TyDecoder , TyEncoder } ;
1414use crate :: ty:: context:: TyCtxt ;
15- use crate :: util:: common:: time;
15+ use crate :: util:: common:: { time, time_ext } ;
1616
1717use errors:: Diagnostic ;
1818use rustc_data_structures:: fx:: FxHashMap ;
@@ -1082,23 +1082,22 @@ fn encode_query_results<'enc, 'a, 'tcx, Q, E>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
10821082 let desc = & format ! ( "encode_query_results for {}" ,
10831083 unsafe { :: std:: intrinsics:: type_name:: <Q >( ) } ) ;
10841084
1085- time ( tcx. sess , desc, || {
1085+ time_ext ( tcx. sess . time_extended ( ) , Some ( tcx. sess ) , desc, || {
1086+ let map = Q :: query_cache ( tcx) . borrow ( ) ;
1087+ assert ! ( map. active. is_empty( ) ) ;
1088+ for ( key, entry) in map. results . iter ( ) {
1089+ if Q :: cache_on_disk ( tcx, key. clone ( ) ) {
1090+ let dep_node = SerializedDepNodeIndex :: new ( entry. index . index ( ) ) ;
10861091
1087- let map = Q :: query_cache ( tcx) . borrow ( ) ;
1088- assert ! ( map. active. is_empty( ) ) ;
1089- for ( key, entry) in map. results . iter ( ) {
1090- if Q :: cache_on_disk ( tcx, key. clone ( ) ) {
1091- let dep_node = SerializedDepNodeIndex :: new ( entry. index . index ( ) ) ;
1092+ // Record position of the cache entry
1093+ query_result_index. push ( ( dep_node, AbsoluteBytePos :: new ( encoder. position ( ) ) ) ) ;
10921094
1093- // Record position of the cache entry
1094- query_result_index. push ( ( dep_node, AbsoluteBytePos :: new ( encoder. position ( ) ) ) ) ;
1095-
1096- // Encode the type check tables with the SerializedDepNodeIndex
1097- // as tag.
1098- encoder. encode_tagged ( dep_node, & entry. value ) ?;
1095+ // Encode the type check tables with the SerializedDepNodeIndex
1096+ // as tag.
1097+ encoder. encode_tagged ( dep_node, & entry. value ) ?;
1098+ }
10991099 }
1100- }
11011100
1102- Ok ( ( ) )
1101+ Ok ( ( ) )
11031102 } )
11041103}
0 commit comments