Skip to content

Commit 202904b

Browse files
committed
make basic CTFE tracing available on release builds
1 parent cb84844 commit 202904b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/librustc_mir/interpret/eval_context.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tc
422422
return_to_block: StackPopCleanup,
423423
) -> EvalResult<'tcx> {
424424
if self.stack.len() > 1 { // FIXME should be "> 0", printing topmost frame crashes rustc...
425-
debug!("PAUSING({}) {}", self.cur_frame(), self.frame().instance);
425+
info!("PAUSING({}) {}", self.cur_frame(), self.frame().instance);
426426
}
427427
::log_settings::settings().indentation += 1;
428428

@@ -491,7 +491,7 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tc
491491
}
492492

493493
if self.stack.len() > 1 { // FIXME no check should be needed, but some instances ICE
494-
debug!("ENTERING({}) {}", self.cur_frame(), self.frame().instance);
494+
info!("ENTERING({}) {}", self.cur_frame(), self.frame().instance);
495495
}
496496

497497
if self.stack.len() > self.tcx.sess.const_eval_stack_frame_limit {
@@ -503,7 +503,7 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tc
503503

504504
pub(super) fn pop_stack_frame(&mut self) -> EvalResult<'tcx> {
505505
if self.stack.len() > 1 { // FIXME no check should be needed, but some instances ICE
506-
debug!("LEAVING({}) {}", self.cur_frame(), self.frame().instance);
506+
info!("LEAVING({}) {}", self.cur_frame(), self.frame().instance);
507507
}
508508
::log_settings::settings().indentation -= 1;
509509
let frame = self.stack.pop().expect(
@@ -557,7 +557,7 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tc
557557
}
558558

559559
if self.stack.len() > 1 { // FIXME should be "> 0", printing topmost frame crashes rustc...
560-
debug!("CONTINUING({}) {}", self.cur_frame(), self.frame().instance);
560+
info!("CONTINUING({}) {}", self.cur_frame(), self.frame().instance);
561561
}
562562

563563
Ok(())

src/librustc_mir/interpret/step.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
8181
}
8282

8383
fn statement(&mut self, stmt: &mir::Statement<'tcx>) -> EvalResult<'tcx> {
84-
debug!("{:?}", stmt);
84+
info!("{:?}", stmt);
8585

8686
use rustc::mir::StatementKind::*;
8787

@@ -293,7 +293,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
293293
}
294294

295295
fn terminator(&mut self, terminator: &mir::Terminator<'tcx>) -> EvalResult<'tcx> {
296-
debug!("{:?}", terminator.kind);
296+
info!("{:?}", terminator.kind);
297297
self.tcx.span = terminator.source_info.span;
298298
self.memory.tcx.span = terminator.source_info.span;
299299

@@ -303,7 +303,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
303303
if !self.stack.is_empty() {
304304
// This should change *something*
305305
debug_assert!(self.cur_frame() != old_stack || self.frame().block != old_bb);
306-
debug!("// {:?}", self.frame().block);
306+
info!("// {:?}", self.frame().block);
307307
}
308308
Ok(())
309309
}

0 commit comments

Comments
 (0)