Rename decode to data_untracked.
This commit is contained in:
parent
b19ae20aad
commit
940fa9251e
3 changed files with 8 additions and 7 deletions
|
@ -840,7 +840,8 @@ impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for Span {
|
||||||
let dlo = u32::decode(decoder)?;
|
let dlo = u32::decode(decoder)?;
|
||||||
let dto = u32::decode(decoder)?;
|
let dto = u32::decode(decoder)?;
|
||||||
|
|
||||||
let enclosing = decoder.tcx.definitions_untracked().def_span(parent.unwrap()).decode();
|
let enclosing =
|
||||||
|
decoder.tcx.definitions_untracked().def_span(parent.unwrap()).data_untracked();
|
||||||
let span = Span::new(
|
let span = Span::new(
|
||||||
enclosing.lo + BytePos::from_u32(dlo),
|
enclosing.lo + BytePos::from_u32(dlo),
|
||||||
enclosing.lo + BytePos::from_u32(dto),
|
enclosing.lo + BytePos::from_u32(dto),
|
||||||
|
@ -1022,7 +1023,7 @@ where
|
||||||
E: 'a + OpaqueEncoder,
|
E: 'a + OpaqueEncoder,
|
||||||
{
|
{
|
||||||
fn encode(&self, s: &mut CacheEncoder<'a, 'tcx, E>) -> Result<(), E::Error> {
|
fn encode(&self, s: &mut CacheEncoder<'a, 'tcx, E>) -> Result<(), E::Error> {
|
||||||
let span_data = self.decode();
|
let span_data = self.data_untracked();
|
||||||
span_data.ctxt.encode(s)?;
|
span_data.ctxt.encode(s)?;
|
||||||
span_data.parent.encode(s)?;
|
span_data.parent.encode(s)?;
|
||||||
|
|
||||||
|
@ -1031,7 +1032,7 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(parent) = span_data.parent {
|
if let Some(parent) = span_data.parent {
|
||||||
let enclosing = s.tcx.definitions_untracked().def_span(parent).decode();
|
let enclosing = s.tcx.definitions_untracked().def_span(parent).data_untracked();
|
||||||
if enclosing.contains(span_data) {
|
if enclosing.contains(span_data) {
|
||||||
TAG_RELATIVE_SPAN.encode(s)?;
|
TAG_RELATIVE_SPAN.encode(s)?;
|
||||||
(span_data.lo - enclosing.lo).to_u32().encode(s)?;
|
(span_data.lo - enclosing.lo).to_u32().encode(s)?;
|
||||||
|
|
|
@ -2032,7 +2032,7 @@ where
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let span = self.decode();
|
let span = self.data_untracked();
|
||||||
span.ctxt.hash_stable(ctx, hasher);
|
span.ctxt.hash_stable(ctx, hasher);
|
||||||
span.parent.hash_stable(ctx, hasher);
|
span.parent.hash_stable(ctx, hasher);
|
||||||
|
|
||||||
|
@ -2042,7 +2042,7 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(parent) = span.parent {
|
if let Some(parent) = span.parent {
|
||||||
let def_span = ctx.def_span(parent).decode();
|
let def_span = ctx.def_span(parent).data_untracked();
|
||||||
if def_span.contains(span) {
|
if def_span.contains(span) {
|
||||||
// This span is enclosed in a definition: only hash the relative position.
|
// This span is enclosed in a definition: only hash the relative position.
|
||||||
Hash::hash(&TAG_RELATIVE_SPAN, hasher);
|
Hash::hash(&TAG_RELATIVE_SPAN, hasher);
|
||||||
|
|
|
@ -101,7 +101,7 @@ impl Span {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn data(self) -> SpanData {
|
pub fn data(self) -> SpanData {
|
||||||
let data = self.decode();
|
let data = self.data_untracked();
|
||||||
if let Some(parent) = data.parent {
|
if let Some(parent) = data.parent {
|
||||||
(*SPAN_TRACK)(parent);
|
(*SPAN_TRACK)(parent);
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,7 @@ impl Span {
|
||||||
/// Internal function to translate between an encoded span and the expanded representation.
|
/// Internal function to translate between an encoded span and the expanded representation.
|
||||||
/// This function must not be used outside the incremental engine.
|
/// This function must not be used outside the incremental engine.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn decode(self) -> SpanData {
|
pub fn data_untracked(self) -> SpanData {
|
||||||
if self.len_or_tag != LEN_TAG {
|
if self.len_or_tag != LEN_TAG {
|
||||||
// Inline format.
|
// Inline format.
|
||||||
debug_assert!(self.len_or_tag as u32 <= MAX_LEN);
|
debug_assert!(self.len_or_tag as u32 <= MAX_LEN);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue