Skip to content

Commit

Permalink
Auto merge of #88934 - tmiasko:trace-log, r=davidtwco
Browse files Browse the repository at this point in the history
Avoid unnecessary formatting when trace log level is disabled
  • Loading branch information
bors committed Sep 17, 2021
2 parents 78a46ef + e84996b commit 38e5764
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions compiler/rustc_const_eval/src/const_eval/eval_queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ fn eval_body_using_ecx<'mir, 'tcx>(
assert!(!layout.is_unsized());
let ret = ecx.allocate(layout, MemoryKind::Stack)?;

let name =
with_no_trimmed_paths(|| ty::tls::with(|tcx| tcx.def_path_str(cid.instance.def_id())));
let prom = cid.promoted.map_or_else(String::new, |p| format!("::promoted[{:?}]", p));
trace!("eval_body_using_ecx: pushing stack frame for global: {}{}", name, prom);
trace!(
"eval_body_using_ecx: pushing stack frame for global: {}{}",
with_no_trimmed_paths(|| ty::tls::with(|tcx| tcx.def_path_str(cid.instance.def_id()))),
cid.promoted.map_or_else(String::new, |p| format!("::promoted[{:?}]", p))
);

ecx.push_stack_frame(
cid.instance,
Expand Down

0 comments on commit 38e5764

Please sign in to comment.