Skip to content

Commit 33fbe3b

Browse files
committed
Uniform enter_trace_span! and add documentation
The macro was uniformed between rustc_const_eval and miri
1 parent 1c3bdb6 commit 33fbe3b

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

src/helpers.rs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,25 +1257,11 @@ pub struct MaybeEnteredTraceSpan {
12571257
/// This is like [rustc_const_eval::enter_trace_span] except that it does not depend on the
12581258
/// [Machine] trait to check if tracing is enabled, because from the Miri codebase we can directly
12591259
/// check whether the "tracing" feature is enabled, unlike from the rustc_const_eval codebase.
1260-
///
1261-
/// In addition to the syntax accepted by [tracing::span!], this macro optionally allows passing
1262-
/// the span name (i.e. the first macro argument) in the form `NAME::SUBNAME` (without quotes) to
1263-
/// indicate that the span has name "NAME" (usually the name of the component) and has an additional
1264-
/// more specific name "SUBNAME" (usually the function name). The latter is passed to the [tracing]
1265-
/// infrastructure as a span field with the name "NAME". This allows not being distracted by
1266-
/// subnames when looking at the trace in <https://ui.perfetto.dev>, but when deeper introspection
1267-
/// is needed within a component, it's still possible to view the subnames directly in the UI by
1268-
/// selecting a span, clicking on the "NAME" argument on the right, and clicking on "Visualize
1269-
/// argument values".
1270-
/// ```rust
1271-
/// // for example, the first will expand to the second
1272-
/// enter_trace_span!(borrow_tracker::on_stack_pop, /* ... */)
1273-
/// enter_trace_span!("borrow_tracker", borrow_tracker = "on_stack_pop", /* ... */)
1274-
/// ```
1260+
/// Look at [rustc_const_eval::enter_trace_span] for complete documentation, examples and tips.
12751261
#[macro_export]
12761262
macro_rules! enter_trace_span {
12771263
($name:ident :: $subname:ident $($tt:tt)*) => {{
1278-
enter_trace_span!(stringify!($name), $name = %stringify!($subname) $($tt)*)
1264+
$crate::enter_trace_span!(stringify!($name), $name = %stringify!($subname) $($tt)*)
12791265
}};
12801266

12811267
($($tt:tt)*) => {

0 commit comments

Comments
 (0)