Track span dependency using a callback.
This commit is contained in:
@@ -840,7 +840,7 @@ impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for Span {
|
||||
let dlo = u32::decode(decoder)?;
|
||||
let dto = u32::decode(decoder)?;
|
||||
|
||||
let enclosing = decoder.tcx.definitions_untracked().def_span(parent.unwrap()).data();
|
||||
let enclosing = decoder.tcx.definitions_untracked().def_span(parent.unwrap()).decode();
|
||||
let span = Span::new(
|
||||
enclosing.lo + BytePos::from_u32(dlo),
|
||||
enclosing.lo + BytePos::from_u32(dto),
|
||||
@@ -1022,7 +1022,7 @@ where
|
||||
E: 'a + OpaqueEncoder,
|
||||
{
|
||||
fn encode(&self, s: &mut CacheEncoder<'a, 'tcx, E>) -> Result<(), E::Error> {
|
||||
let span_data = self.data();
|
||||
let span_data = self.decode();
|
||||
span_data.ctxt.encode(s)?;
|
||||
span_data.parent.encode(s)?;
|
||||
|
||||
@@ -1031,7 +1031,7 @@ where
|
||||
}
|
||||
|
||||
if let Some(parent) = span_data.parent {
|
||||
let enclosing = s.tcx.definitions_untracked().def_span(parent).data();
|
||||
let enclosing = s.tcx.definitions_untracked().def_span(parent).decode();
|
||||
if enclosing.contains(span_data) {
|
||||
TAG_RELATIVE_SPAN.encode(s)?;
|
||||
(span_data.lo - enclosing.lo).to_u32().encode(s)?;
|
||||
|
||||
Reference in New Issue
Block a user