diff --git a/library/src/layout/grid.rs b/library/src/layout/grid.rs index acfee8a27..1e4bf40b8 100644 --- a/library/src/layout/grid.rs +++ b/library/src/layout/grid.rs @@ -290,7 +290,6 @@ impl<'a, 'v> GridLayouter<'a, 'v> { } /// Determines the columns sizes and then layouts the grid row-by-row. - #[tracing::instrument(name = "grid layout", skip(self))] pub fn layout(mut self) -> SourceResult { self.measure_columns()?; @@ -318,6 +317,7 @@ impl<'a, 'v> GridLayouter<'a, 'v> { } /// Determine all column sizes. + #[tracing::instrument(name = "GridLayouter::measure_columns", skip_all)] fn measure_columns(&mut self) -> SourceResult<()> { // Sum of sizes of resolved relative tracks. let mut rel = Abs::zero(); diff --git a/library/src/layout/mod.rs b/library/src/layout/mod.rs index 16ac46bbe..92e36b58e 100644 --- a/library/src/layout/mod.rs +++ b/library/src/layout/mod.rs @@ -116,6 +116,7 @@ pub trait Layout { /// /// This element must be layouted again in the same order for the results to /// be valid. + #[tracing::instrument(name = "Layout::measure", skip_all)] fn measure( &self, vt: &mut Vt, @@ -198,6 +199,7 @@ fn realize_root<'a>( } /// Realize into an element that is capable of block-level layout. +#[tracing::instrument(skip_all)] fn realize_block<'a>( vt: &mut Vt, scratch: &'a Scratch<'a>, @@ -261,7 +263,6 @@ impl<'a, 'v, 't> Builder<'a, 'v, 't> { } } - #[tracing::instrument(skip_all)] fn accept( &mut self, mut content: &'a Content, @@ -327,7 +328,6 @@ impl<'a, 'v, 't> Builder<'a, 'v, 't> { } } - #[tracing::instrument(skip_all)] fn styled( &mut self, elem: &'a Content, @@ -342,7 +342,6 @@ impl<'a, 'v, 't> Builder<'a, 'v, 't> { Ok(()) } - #[tracing::instrument(skip(self, local, outer))] fn interrupt_style( &mut self, local: &Styles, @@ -377,7 +376,6 @@ impl<'a, 'v, 't> Builder<'a, 'v, 't> { Ok(()) } - #[tracing::instrument(skip(self))] fn interrupt_list(&mut self) -> SourceResult<()> { if !self.list.items.is_empty() { let staged = mem::take(&mut self.list.staged); @@ -391,7 +389,6 @@ impl<'a, 'v, 't> Builder<'a, 'v, 't> { Ok(()) } - #[tracing::instrument(skip(self))] fn interrupt_par(&mut self) -> SourceResult<()> { self.interrupt_list()?; if !self.par.0.is_empty() { @@ -403,7 +400,6 @@ impl<'a, 'v, 't> Builder<'a, 'v, 't> { Ok(()) } - #[tracing::instrument(skip_all)] fn interrupt_page(&mut self, styles: Option>) -> SourceResult<()> { self.interrupt_par()?; let Some(doc) = &mut self.doc else { return Ok(()) }; diff --git a/src/model/content.rs b/src/model/content.rs index 1bd19f141..4eeecbd6b 100644 --- a/src/model/content.rs +++ b/src/model/content.rs @@ -39,19 +39,16 @@ enum Attr { impl Content { /// Create an empty element. - #[tracing::instrument()] pub fn new(func: ElemFunc) -> Self { Self { func, attrs: EcoVec::new() } } /// Create empty content. - #[tracing::instrument()] pub fn empty() -> Self { Self::new(SequenceElem::func()) } /// Create a new sequence element from multiples elements. - #[tracing::instrument(skip_all)] pub fn sequence(iter: impl IntoIterator) -> Self { let mut iter = iter.into_iter(); let Some(first) = iter.next() else { return Self::empty() }; @@ -94,7 +91,6 @@ impl Content { } /// Access the child and styles. - #[tracing::instrument(skip_all)] pub fn to_styled(&self) -> Option<(&Content, &Styles)> { if !self.is::() { return None; @@ -120,7 +116,6 @@ impl Content { /// Cast to a trait object if the contained element has the given /// capability. - #[tracing::instrument(skip_all)] pub fn with(&self) -> Option<&C> where C: ?Sized + 'static, @@ -132,7 +127,6 @@ impl Content { /// Cast to a mutable trait object if the contained element has the given /// capability. - #[tracing::instrument(skip_all)] pub fn with_mut(&mut self) -> Option<&mut C> where C: ?Sized + 'static, @@ -180,7 +174,6 @@ impl Content { } /// Access a field on the content. - #[tracing::instrument(skip_all)] pub fn field(&self, name: &str) -> Option { if let (Some(iter), "children") = (self.to_sequence(), name) { Some(Value::Array(iter.cloned().map(Value::Content).collect())) diff --git a/src/model/styles.rs b/src/model/styles.rs index efbdb9d11..54784307e 100644 --- a/src/model/styles.rs +++ b/src/model/styles.rs @@ -563,7 +563,6 @@ impl<'a> StyleChain<'a> { /// The resulting style chain contains styles from `local` as well as /// `self`. The ones from `local` take precedence over the ones from /// `self`. For folded properties `local` contributes the inner value. - #[tracing::instrument(skip_all)] pub fn chain<'b>(&'b self, local: &'b Styles) -> StyleChain<'b> { if local.is_empty() { *self @@ -573,7 +572,6 @@ impl<'a> StyleChain<'a> { } /// Cast the first value for the given property in the chain. - #[tracing::instrument(skip_all)] pub fn get( self, func: ElemFunc, @@ -587,7 +585,6 @@ impl<'a> StyleChain<'a> { } /// Cast the first value for the given property in the chain. - #[tracing::instrument(skip_all)] pub fn get_resolve( self, func: ElemFunc, @@ -599,7 +596,6 @@ impl<'a> StyleChain<'a> { } /// Cast the first value for the given property in the chain. - #[tracing::instrument(skip_all)] pub fn get_fold( self, func: ElemFunc, @@ -621,7 +617,6 @@ impl<'a> StyleChain<'a> { } /// Cast the first value for the given property in the chain. - #[tracing::instrument(skip_all)] pub fn get_resolve_fold( self, func: ElemFunc, @@ -656,7 +651,6 @@ impl<'a> StyleChain<'a> { } /// Iterate over all values for the given property in the chain. - #[tracing::instrument(skip_all)] pub fn properties( self, func: ElemFunc, diff --git a/src/syntax/source.rs b/src/syntax/source.rs index b325cf9ea..f67ed6565 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") diff --git a/src/util/mod.rs b/src/util/mod.rs index 83ec5961d..f96fa55e9 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -34,7 +34,6 @@ where } /// Calculate a 128-bit siphash of a value. -#[tracing::instrument(skip_all)] pub fn hash128(value: &T) -> u128 { let mut state = SipHasher13::new(); value.hash(&mut state);