diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-04-27 19:24:33 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2021-09-10 20:18:18 +0200 |
| commit | b19ae20aada117a589ec238f97c97a98b483f97d (patch) | |
| tree | 47dde9a7f58604722b43c70c288edd2a70f8f561 /compiler/rustc_span/src/lib.rs | |
| parent | e85ddeb474665f3af7c447445c273da6117e266d (diff) | |
| download | rust-b19ae20aada117a589ec238f97c97a98b483f97d.tar.gz rust-b19ae20aada117a589ec238f97c97a98b483f97d.zip | |
Track span dependency using a callback.
Diffstat (limited to 'compiler/rustc_span/src/lib.rs')
| -rw-r--r-- | compiler/rustc_span/src/lib.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs index de08c5d8a55..60b5ffb1d3e 100644 --- a/compiler/rustc_span/src/lib.rs +++ b/compiler/rustc_span/src/lib.rs @@ -1947,6 +1947,7 @@ pub struct FileLines { pub static SPAN_DEBUG: AtomicRef<fn(Span, &mut fmt::Formatter<'_>) -> fmt::Result> = AtomicRef::new(&(default_span_debug as fn(_, &mut fmt::Formatter<'_>) -> _)); +pub static SPAN_TRACK: AtomicRef<fn(LocalDefId)> = AtomicRef::new(&((|_| {}) as fn(_))); // _____________________________________________________________________________ // SpanLinesError, SpanSnippetError, DistinctSources, MalformedSourceMapPositions @@ -2031,7 +2032,7 @@ where return; } - let span = self.data(); + let span = self.decode(); span.ctxt.hash_stable(ctx, hasher); span.parent.hash_stable(ctx, hasher); @@ -2041,7 +2042,7 @@ where } if let Some(parent) = span.parent { - let def_span = ctx.def_span(parent).data(); + let def_span = ctx.def_span(parent).decode(); if def_span.contains(span) { // This span is enclosed in a definition: only hash the relative position. Hash::hash(&TAG_RELATIVE_SPAN, hasher); |
