1
Fork 0

Avoid a source_span query when encoding Spans into query results

This commit is contained in:
John Kåre Alsaker 2023-09-08 02:08:52 +02:00
parent c5775a776f
commit 2a5121b131
2 changed files with 15 additions and 13 deletions

View file

@ -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);