Skip to content

Commit f4bc4cd

Browse files
committed
Add TRACING_ENABLED to Machine trait
1 parent 4eca99a commit f4bc4cd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/rustc_const_eval/src/interpret/machine.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ pub trait Machine<'tcx>: Sized {
147147
/// already been checked before.
148148
const ALL_CONSTS_ARE_PRECHECKED: bool = true;
149149

150+
/// Determines whether rustc_const_eval functions that make use of the [Machine] should make
151+
/// tracing calls (to the `tracing` library). By default this is `false`, meaning the tracing
152+
/// calls will supposedly be optimized out. This flag is set to `true` inside Miri, to allow
153+
/// tracing the interpretation steps, among other things.
154+
const TRACING_ENABLED: bool = false;
155+
150156
/// Whether memory accesses should be alignment-checked.
151157
fn enforce_alignment(ecx: &InterpCx<'tcx, Self>) -> bool;
152158

0 commit comments

Comments
 (0)