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 {}
114
114
/// ```
115
115
#[ macro_export]
116
116
macro_rules! enter_trace_span {
117
- ( $machine: ident , $name: ident :: $subname: ident $( $tt: tt) * ) => { {
117
+ ( $machine: ty , $name: ident :: $subname: ident $( $tt: tt) * ) => {
118
118
$crate:: enter_trace_span!( $machine, stringify!( $name) , $name = %stringify!( $subname) $( $tt) * )
119
- } } ;
119
+ } ;
120
120
121
- ( $machine: ident , $( $tt: tt) * ) => {
121
+ ( $machine: ty , $( $tt: tt) * ) => {
122
122
<$machine as $crate:: interpret:: Machine >:: enter_trace_span( || tracing:: info_span!( $( $tt) * ) )
123
- }
123
+ } ;
124
124
}
Original file line number Diff line number Diff line change @@ -1254,20 +1254,13 @@ pub struct MaybeEnteredTraceSpan {
1254
1254
}
1255
1255
1256
1256
/// 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) .
1260
1260
/// Look at [rustc_const_eval::enter_trace_span] for complete documentation, examples and tips.
1261
1261
#[ macro_export]
1262
1262
macro_rules! enter_trace_span {
1263
- ( $name: ident :: $subname: ident $( $tt: tt) * ) => { {
1264
- $crate:: enter_trace_span!( stringify!( $name) , $name = %stringify!( $subname) $( $tt) * )
1265
- } } ;
1266
-
1267
1263
( $( $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) * )
1272
1265
} ;
1273
1266
}
You can’t perform that action at this time.
0 commit comments