X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc%2Fty%2Fquery%2Fon_disk_cache.rs;h=aaadbf289356811091d4ff393b53f845a562fd44;hb=e842f570d9a7f2e77e4b49b7a7e0f329de2b5e18;hp=c16f861dedb50442a88f1c3bf6bb60a0dd72125f;hpb=a1a17f5c6663a6a22a58505a6a925b44dfc016e9;p=rust.git diff --git a/src/librustc/ty/query/on_disk_cache.rs b/src/librustc/ty/query/on_disk_cache.rs index c16f861dedb..aaadbf28935 100644 --- a/src/librustc/ty/query/on_disk_cache.rs +++ b/src/librustc/ty/query/on_disk_cache.rs @@ -12,7 +12,7 @@ use crate::ty; use crate::ty::codec::{self as ty_codec, TyDecoder, TyEncoder}; use crate::ty::context::TyCtxt; -use crate::util::common::time; +use crate::util::common::{time, time_ext}; use errors::Diagnostic; use rustc_data_structures::fx::FxHashMap; @@ -1082,23 +1082,22 @@ fn encode_query_results<'enc, 'a, 'tcx, Q, E>(tcx: TyCtxt<'a, 'tcx, 'tcx>, let desc = &format!("encode_query_results for {}", unsafe { ::std::intrinsics::type_name::() }); - time(tcx.sess, desc, || { + time_ext(tcx.sess.time_extended(), Some(tcx.sess), desc, || { + let map = Q::query_cache(tcx).borrow(); + assert!(map.active.is_empty()); + for (key, entry) in map.results.iter() { + if Q::cache_on_disk(tcx, key.clone()) { + let dep_node = SerializedDepNodeIndex::new(entry.index.index()); - let map = Q::query_cache(tcx).borrow(); - assert!(map.active.is_empty()); - for (key, entry) in map.results.iter() { - if Q::cache_on_disk(tcx, key.clone()) { - let dep_node = SerializedDepNodeIndex::new(entry.index.index()); + // Record position of the cache entry + query_result_index.push((dep_node, AbsoluteBytePos::new(encoder.position()))); - // Record position of the cache entry - query_result_index.push((dep_node, AbsoluteBytePos::new(encoder.position()))); - - // Encode the type check tables with the SerializedDepNodeIndex - // as tag. - encoder.encode_tagged(dep_node, &entry.value)?; + // Encode the type check tables with the SerializedDepNodeIndex + // as tag. + encoder.encode_tagged(dep_node, &entry.value)?; + } } - } - Ok(()) + Ok(()) }) }