Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove source_span_untracked #108034

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions compiler/rustc_middle/src/ty/context.rs
Original file line number Diff line number Diff line change
@@ -981,13 +981,6 @@ impl<'tcx> TyCtxt<'tcx> {
self.untracked.definitions.read()
}

/// Note that this is *untracked* and should only be used within the query
/// system if the result is otherwise tracked through queries
#[inline]
pub fn source_span_untracked(self, def_id: LocalDefId) -> Span {
self.untracked.source_span.get(def_id).copied().unwrap_or(DUMMY_SP)
}

#[inline(always)]
pub fn with_stable_hashing_context<R>(
self,
6 changes: 5 additions & 1 deletion compiler/rustc_query_impl/src/on_disk_cache.rs
Original file line number Diff line number Diff line change
@@ -695,7 +695,11 @@ impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for Span {
let dlo = u32::decode(decoder);
let dto = u32::decode(decoder);

let enclosing = decoder.tcx.source_span_untracked(parent.unwrap()).data_untracked();
let enclosing = decoder
.tcx
.dep_graph
.with_ignore(|| decoder.tcx.source_span(parent.unwrap()))
.data_untracked();
let span = Span::new(
enclosing.lo + BytePos::from_u32(dlo),
enclosing.lo + BytePos::from_u32(dto),