diff options
| author | James Higgins <james.isaac.higgins@gmail.com> | 2022-04-16 00:32:18 -0300 |
|---|---|---|
| committer | Mark Rousskov <mark.simulacrum@gmail.com> | 2022-04-24 11:24:04 -0400 |
| commit | 0fea00759fea1b25a60d2b729f61c885399bda83 (patch) | |
| tree | 5743dc37bde4db7c73c787f29a807061a3078a47 /src/bootstrap | |
| parent | b759b2218649016cc40e82bdd6d958e2277ff6d7 (diff) | |
| download | rust-0fea00759fea1b25a60d2b729f61c885399bda83.tar.gz rust-0fea00759fea1b25a60d2b729f61c885399bda83.zip | |
Add type_name info to [TIMING] log output
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/builder.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 0c4f3265dbf..f803388f0a6 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -1,4 +1,4 @@ -use std::any::Any; +use std::any::{type_name, Any}; use std::cell::{Cell, RefCell}; use std::collections::BTreeSet; use std::env; @@ -1763,7 +1763,16 @@ impl<'a> Builder<'a> { }; if self.config.print_step_timings && !self.config.dry_run { - println!("[TIMING] {:?} -- {}.{:03}", step, dur.as_secs(), dur.subsec_millis()); + let step_string = format!("{:?}", step); + let brace_index = step_string.find("{").unwrap_or(0); + let type_string = type_name::<S>(); + println!( + "[TIMING] {} {} -- {}.{:03}", + &type_string.strip_prefix("bootstrap::").unwrap_or(type_string), + &step_string[brace_index..], + dur.as_secs(), + dur.subsec_millis() + ); } { |
