Skip to content

Commit 38e5764

Browse files
committed
Auto merge of #88934 - tmiasko:trace-log, r=davidtwco
Avoid unnecessary formatting when trace log level is disabled
2 parents 78a46ef + e84996b commit 38e5764

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Diff for: compiler/rustc_const_eval/src/const_eval/eval_queries.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@ fn eval_body_using_ecx<'mir, 'tcx>(
5151
assert!(!layout.is_unsized());
5252
let ret = ecx.allocate(layout, MemoryKind::Stack)?;
5353

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

5960
ecx.push_stack_frame(
6061
cid.instance,

0 commit comments

Comments
 (0)