]> git.lizzy.rs Git - rust.git/commitdiff
Remove some span tracking.
authorCamille GILLOT <gillot.camille@gmail.com>
Fri, 30 Apr 2021 18:16:09 +0000 (20:16 +0200)
committerCamille GILLOT <gillot.camille@gmail.com>
Fri, 10 Sep 2021 18:19:07 +0000 (20:19 +0200)
compiler/rustc_span/src/lib.rs

index 4f69a59ab93a5c9d8bcf79ebdd918f2f27626b60..eb496140553ad80619d0a3bd0784c99db7cad80d 100644 (file)
@@ -521,11 +521,11 @@ pub fn with_hi(self, hi: BytePos) -> Span {
     }
     #[inline]
     pub fn ctxt(self) -> SyntaxContext {
-        self.data().ctxt
+        self.data_untracked().ctxt
     }
     #[inline]
     pub fn with_ctxt(self, ctxt: SyntaxContext) -> Span {
-        self.data().with_ctxt(ctxt)
+        self.data_untracked().with_ctxt(ctxt)
     }
     #[inline]
     pub fn parent(self) -> Option<LocalDefId> {
@@ -539,7 +539,7 @@ pub fn with_parent(self, ctxt: Option<LocalDefId>) -> Span {
     /// Returns `true` if this is a dummy span with any hygienic context.
     #[inline]
     pub fn is_dummy(self) -> bool {
-        self.data().is_dummy()
+        self.data_untracked().is_dummy()
     }
 
     /// Returns `true` if this span comes from a macro or desugaring.
@@ -561,20 +561,20 @@ pub fn with_root_ctxt(lo: BytePos, hi: BytePos) -> Span {
     /// Returns a new span representing an empty span at the beginning of this span.
     #[inline]
     pub fn shrink_to_lo(self) -> Span {
-        let span = self.data();
+        let span = self.data_untracked();
         span.with_hi(span.lo)
     }
     /// Returns a new span representing an empty span at the end of this span.
     #[inline]
     pub fn shrink_to_hi(self) -> Span {
-        let span = self.data();
+        let span = self.data_untracked();
         span.with_lo(span.hi)
     }
 
     #[inline]
     /// Returns `true` if `hi == lo`.
     pub fn is_empty(&self) -> bool {
-        let span = self.data();
+        let span = self.data_untracked();
         span.hi == span.lo
     }