File tree Expand file tree Collapse file tree 2 files changed +8
-15
lines changed
compiler/rustc_const_eval/src/interpret Expand file tree Collapse file tree 2 files changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -114,11 +114,11 @@ impl EnteredTraceSpan for tracing::span::EnteredSpan {}
114114/// ```
115115#[ macro_export]
116116macro_rules! enter_trace_span {
117- ( $machine: ident , $name: ident :: $subname: ident $( $tt: tt) * ) => { {
117+ ( $machine: ty , $name: ident :: $subname: ident $( $tt: tt) * ) => {
118118 $crate:: enter_trace_span!( $machine, stringify!( $name) , $name = %stringify!( $subname) $( $tt) * )
119- } } ;
119+ } ;
120120
121- ( $machine: ident , $( $tt: tt) * ) => {
121+ ( $machine: ty , $( $tt: tt) * ) => {
122122 <$machine as $crate:: interpret:: Machine >:: enter_trace_span( || tracing:: info_span!( $( $tt) * ) )
123- }
123+ } ;
124124}
Original file line number Diff line number Diff line change @@ -1254,20 +1254,13 @@ pub struct MaybeEnteredTraceSpan {
12541254}
12551255
12561256/// Enters a [tracing::info_span] only if the "tracing" feature is enabled, otherwise does nothing.
1257- /// This is like [rustc_const_eval::enter_trace_span] except that it does not depend on the
1258- /// [Machine] trait to check if tracing is enabled, because from the Miri codebase we can directly
1259- /// check whether the "tracing" feature is enabled, unlike from the rustc_const_eval codebase .
1257+ /// This calls [rustc_const_eval::enter_trace_span] with [MiriMachine] as the first argument, which
1258+ /// will in turn call [MiriMachine::enter_trace_span], which takes care of determining at compile
1259+ /// time whether to trace or not (and supposedly the call is compiled out if tracing is disabled) .
12601260/// Look at [rustc_const_eval::enter_trace_span] for complete documentation, examples and tips.
12611261#[ macro_export]
12621262macro_rules! enter_trace_span {
1263- ( $name: ident :: $subname: ident $( $tt: tt) * ) => { {
1264- $crate:: enter_trace_span!( stringify!( $name) , $name = %stringify!( $subname) $( $tt) * )
1265- } } ;
1266-
12671263 ( $( $tt: tt) * ) => {
1268- $crate:: MaybeEnteredTraceSpan {
1269- #[ cfg( feature = "tracing" ) ]
1270- _entered_span: tracing:: info_span!( $( $tt) * ) . entered( )
1271- }
1264+ rustc_const_eval:: enter_trace_span!( $crate:: MiriMachine <' static >, $( $tt) * )
12721265 } ;
12731266}
You can’t perform that action at this time.
0 commit comments