We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4bc4cd commit 7261a79Copy full SHA for 7261a79
compiler/rustc_const_eval/src/interpret/mod.rs
@@ -14,6 +14,7 @@ mod place;
14
mod projection;
15
mod stack;
16
mod step;
17
+mod tracing_utils;
18
mod traits;
19
mod util;
20
mod validity;
compiler/rustc_const_eval/src/interpret/tracing_utils.rs
@@ -0,0 +1,18 @@
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())
+ } else {
+ $crate::interpret::tracing_utils::MaybeEnteredSpan::None
+ }
0 commit comments