From 998a3c44fd79eac92c375ec9e755288bc146a279 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Thu, 11 May 2023 11:35:45 +0200 Subject: Remove tracing from cheap functions Turns out that having tracing enabled on some functions that get called a lot distorts the traces so that their parent stack frames look much more expensive than they actually are. --- src/syntax/source.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/syntax') diff --git a/src/syntax/source.rs b/src/syntax/source.rs index b325cf9e..f67ed656 100644 --- a/src/syntax/source.rs +++ b/src/syntax/source.rs @@ -109,6 +109,7 @@ impl Source { /// Returns the range in the new source that was ultimately reparsed. /// /// The method panics if the `replace` range is out of bounds. + #[track_caller] pub fn edit(&mut self, replace: Range, with: &str) -> Range { let start_byte = replace.start; let start_utf16 = self.byte_to_utf16(replace.start).unwrap(); @@ -158,6 +159,7 @@ impl Source { /// Map a span that points into this source file to a byte range. /// /// Panics if the span does not point into this source file. + #[track_caller] pub fn range(&self, span: Span) -> Range { self.find(span) .expect("span does not point into this source file") -- cgit v1.2.3