mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Avoid a source_span
query when encoding Spans into query results
This commit is contained in:
parent
c5775a776f
commit
2a5121b131
@ -47,18 +47,6 @@ pub fn save_dep_graph(tcx: TyCtxt<'_>) {
|
||||
}
|
||||
|
||||
join(
|
||||
move || {
|
||||
sess.time("incr_comp_persist_result_cache", || {
|
||||
// Drop the memory map so that we can remove the file and write to it.
|
||||
if let Some(odc) = &tcx.query_system.on_disk_cache {
|
||||
odc.drop_serialized_data(tcx);
|
||||
}
|
||||
|
||||
file_format::save_in(sess, query_cache_path, "query cache", |e| {
|
||||
encode_query_cache(tcx, e)
|
||||
});
|
||||
});
|
||||
},
|
||||
move || {
|
||||
sess.time("incr_comp_persist_dep_graph", || {
|
||||
if let Err(err) = tcx.dep_graph.encode(&tcx.sess.prof) {
|
||||
@ -73,6 +61,20 @@ pub fn save_dep_graph(tcx: TyCtxt<'_>) {
|
||||
}
|
||||
});
|
||||
},
|
||||
move || {
|
||||
// We execute this after `incr_comp_persist_dep_graph` for the serial compiler
|
||||
// to catch any potential query execution writing to the dep graph.
|
||||
sess.time("incr_comp_persist_result_cache", || {
|
||||
// Drop the memory map so that we can remove the file and write to it.
|
||||
if let Some(odc) = &tcx.query_system.on_disk_cache {
|
||||
odc.drop_serialized_data(tcx);
|
||||
}
|
||||
|
||||
file_format::save_in(sess, query_cache_path, "query cache", |e| {
|
||||
encode_query_cache(tcx, e)
|
||||
});
|
||||
});
|
||||
},
|
||||
);
|
||||
})
|
||||
}
|
||||
|
@ -896,7 +896,7 @@ impl<'a, 'tcx> Encodable<CacheEncoder<'a, 'tcx>> for Span {
|
||||
}
|
||||
|
||||
if let Some(parent) = span_data.parent {
|
||||
let enclosing = s.tcx.source_span(parent).data_untracked();
|
||||
let enclosing = s.tcx.source_span_untracked(parent).data_untracked();
|
||||
if enclosing.contains(span_data) {
|
||||
TAG_RELATIVE_SPAN.encode(s);
|
||||
(span_data.lo - enclosing.lo).to_u32().encode(s);
|
||||
|
Loading…
Reference in New Issue
Block a user