Skip to content

Commit db2679d

Browse files
committed
Remove source_span_untracked
it only has one caller, and we can avoid query dep tracking and still call the query
1 parent e9ab787 commit db2679d

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

compiler/rustc_middle/src/ty/context.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -981,13 +981,6 @@ impl<'tcx> TyCtxt<'tcx> {
981981
self.untracked.definitions.read()
982982
}
983983

984-
/// Note that this is *untracked* and should only be used within the query
985-
/// system if the result is otherwise tracked through queries
986-
#[inline]
987-
pub fn source_span_untracked(self, def_id: LocalDefId) -> Span {
988-
self.untracked.source_span.get(def_id).copied().unwrap_or(DUMMY_SP)
989-
}
990-
991984
#[inline(always)]
992985
pub fn with_stable_hashing_context<R>(
993986
self,

compiler/rustc_query_impl/src/on_disk_cache.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,11 @@ impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for Span {
695695
let dlo = u32::decode(decoder);
696696
let dto = u32::decode(decoder);
697697

698-
let enclosing = decoder.tcx.source_span_untracked(parent.unwrap()).data_untracked();
698+
let enclosing = decoder
699+
.tcx
700+
.dep_graph
701+
.with_ignore(|| decoder.tcx.source_span(parent.unwrap()))
702+
.data_untracked();
699703
let span = Span::new(
700704
enclosing.lo + BytePos::from_u32(dlo),
701705
enclosing.lo + BytePos::from_u32(dto),

0 commit comments

Comments
 (0)