@@ -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 ;
@@ -1080,23 +1080,22 @@ fn encode_query_results<'enc, 'a, 'tcx, Q, E>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
10801080 let desc = & format ! ( "encode_query_results for {}" ,
10811081 unsafe { :: std:: intrinsics:: type_name:: <Q >( ) } ) ;
10821082
1083- time ( tcx. sess , desc, || {
1083+ time_ext ( tcx. sess . time_extended ( ) , Some ( tcx. sess ) , desc, || {
1084+ let map = Q :: query_cache ( tcx) . borrow ( ) ;
1085+ assert ! ( map. active. is_empty( ) ) ;
1086+ for ( key, entry) in map. results . iter ( ) {
1087+ if Q :: cache_on_disk ( tcx, key. clone ( ) ) {
1088+ let dep_node = SerializedDepNodeIndex :: new ( entry. index . index ( ) ) ;
10841089
1085- let map = Q :: query_cache ( tcx) . borrow ( ) ;
1086- assert ! ( map. active. is_empty( ) ) ;
1087- for ( key, entry) in map. results . iter ( ) {
1088- if Q :: cache_on_disk ( tcx, key. clone ( ) ) {
1089- let dep_node = SerializedDepNodeIndex :: new ( entry. index . index ( ) ) ;
1090+ // Record position of the cache entry
1091+ query_result_index. push ( ( dep_node, AbsoluteBytePos :: new ( encoder. position ( ) ) ) ) ;
10901092
1091- // Record position of the cache entry
1092- query_result_index. push ( ( dep_node, AbsoluteBytePos :: new ( encoder. position ( ) ) ) ) ;
1093-
1094- // Encode the type check tables with the SerializedDepNodeIndex
1095- // as tag.
1096- encoder. encode_tagged ( dep_node, & entry. value ) ?;
1093+ // Encode the type check tables with the SerializedDepNodeIndex
1094+ // as tag.
1095+ encoder. encode_tagged ( dep_node, & entry. value ) ?;
1096+ }
10971097 }
1098- }
10991098
1100- Ok ( ( ) )
1099+ Ok ( ( ) )
11011100 } )
11021101}
0 commit comments