File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
compiler/rustc_const_eval/src/interpret Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ mod traits;
18
18
mod util;
19
19
mod validity;
20
20
mod visitor;
21
+ mod tracing_utils;
21
22
22
23
#[ doc( no_inline) ]
23
24
pub use rustc_middle:: mir:: interpret:: * ; // have all the `interpret` symbols in one place: here
Original file line number Diff line number Diff line change
1
+ /// This struct is needed to enforce `#[must_use]` on [tracing::span::EnteredSpan]
2
+ /// while wrapping them in an `Option`.
3
+ #[ must_use]
4
+ pub enum MaybeEnteredSpan {
5
+ Some ( tracing:: span:: EnteredSpan ) ,
6
+ None ,
7
+ }
8
+
9
+ #[ macro_export]
10
+ macro_rules! enter_trace_span {
11
+ ( $machine: ident, $( $tt: tt) * ) => {
12
+ if $machine:: TRACING_ENABLED {
13
+ $crate:: interpret:: tracing_utils:: MaybeEnteredSpan :: Some ( tracing:: info_span!( $( $tt) * ) . entered( ) )
14
+ } else {
15
+ $crate:: interpret:: tracing_utils:: MaybeEnteredSpan :: None
16
+ }
17
+ }
18
+ }
You can’t perform that action at this time.
0 commit comments