about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-09-17 03:47:23 +0000
committerbors <bors@rust-lang.org>2021-09-17 03:47:23 +0000
commit38e576423dc56a006ccf0b72e106f09bdea6efc2 (patch)
tree50906e563bdfe62f6c38342731223e3d19af485d
parent78a46efff06558674b51c10d8d81758285746ab5 (diff)
parente84996bd7f157ef6ce20f930a6e81fe8f47ba050 (diff)
downloadrust-38e576423dc56a006ccf0b72e106f09bdea6efc2.tar.gz
rust-38e576423dc56a006ccf0b72e106f09bdea6efc2.zip
Auto merge of #88934 - tmiasko:trace-log, r=davidtwco
Avoid unnecessary formatting when trace log level is disabled
-rw-r--r--compiler/rustc_const_eval/src/const_eval/eval_queries.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/eval_queries.rs b/compiler/rustc_const_eval/src/const_eval/eval_queries.rs
index 171fc45ea46..57af0ff0714 100644
--- a/compiler/rustc_const_eval/src/const_eval/eval_queries.rs
+++ b/compiler/rustc_const_eval/src/const_eval/eval_queries.rs
@@ -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,