From 940fa9251e3c538a4c9d35d84dcaa09065e45687 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Fri, 30 Apr 2021 20:15:22 +0200 Subject: [PATCH] Rename decode to data_untracked. --- compiler/rustc_query_impl/src/on_disk_cache.rs | 7 ++++--- compiler/rustc_span/src/lib.rs | 4 ++-- compiler/rustc_span/src/span_encoding.rs | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/compiler/rustc_query_impl/src/on_disk_cache.rs b/compiler/rustc_query_impl/src/on_disk_cache.rs index 08565812278..a54d1556b3e 100644 --- a/compiler/rustc_query_impl/src/on_disk_cache.rs +++ b/compiler/rustc_query_impl/src/on_disk_cache.rs @@ -840,7 +840,8 @@ fn decode(decoder: &mut CacheDecoder<'a, 'tcx>) -> Result { let dlo = 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( enclosing.lo + BytePos::from_u32(dlo), enclosing.lo + BytePos::from_u32(dto), @@ -1022,7 +1023,7 @@ impl<'a, 'tcx, E> Encodable> for Span E: 'a + OpaqueEncoder, { 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.parent.encode(s)?; @@ -1031,7 +1032,7 @@ fn encode(&self, s: &mut CacheEncoder<'a, 'tcx, E>) -> Result<(), E::Error> { } 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) { TAG_RELATIVE_SPAN.encode(s)?; (span_data.lo - enclosing.lo).to_u32().encode(s)?; diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs index 60b5ffb1d3e..4f69a59ab93 100644 --- a/compiler/rustc_span/src/lib.rs +++ b/compiler/rustc_span/src/lib.rs @@ -2032,7 +2032,7 @@ fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) { return; } - let span = self.decode(); + let span = self.data_untracked(); span.ctxt.hash_stable(ctx, hasher); span.parent.hash_stable(ctx, hasher); @@ -2042,7 +2042,7 @@ fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) { } 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) { // This span is enclosed in a definition: only hash the relative position. Hash::hash(&TAG_RELATIVE_SPAN, hasher); diff --git a/compiler/rustc_span/src/span_encoding.rs b/compiler/rustc_span/src/span_encoding.rs index f74c259d53d..e9120b98aab 100644 --- a/compiler/rustc_span/src/span_encoding.rs +++ b/compiler/rustc_span/src/span_encoding.rs @@ -101,7 +101,7 @@ pub fn new( #[inline] pub fn data(self) -> SpanData { - let data = self.decode(); + let data = self.data_untracked(); if let Some(parent) = data.parent { (*SPAN_TRACK)(parent); } @@ -111,7 +111,7 @@ pub fn data(self) -> SpanData { /// Internal function to translate between an encoded span and the expanded representation. /// This function must not be used outside the incremental engine. #[inline] - pub fn decode(self) -> SpanData { + pub fn data_untracked(self) -> SpanData { if self.len_or_tag != LEN_TAG { // Inline format. debug_assert!(self.len_or_tag as u32 <= MAX_LEN);