Skip to content

Commit 444a756

Browse files
committed
Revise prefix a bit, adding both --test (conditionally) and [RUSTC-SHIM] unconditionally.
1. I added `--test` based on review feedback from simulacrum: I decided I would rather include such extra context than get confused later on by its absence. (However, I chose to encode it differently than how `[RUSTC-TIMING]` does... I don't have much basis for doing so, other than `--test` to me more directly reflects what it came from.) 2. I also decided to include `[RUSTC-SHIM]` at start of all of these lines driven by the verbosity level, to make to clear where these lines of text originate from. (Basically, I skimmed over the output and realized that a casual observer might not be able to tell where this huge set of new lines were coming from.)
1 parent f5eb5c8 commit 444a756

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/bootstrap/bin/rustc.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,14 @@ fn main() {
138138
cmd.arg("-Z").arg("force-unstable-if-unmarked");
139139
}
140140

141+
let is_test = args.iter().any(|a| a == "--test");
141142
if verbose > 1 {
142143
let rust_env_vars =
143144
env::vars().filter(|(k, _)| k.starts_with("RUST") || k.starts_with("CARGO"));
145+
let prefix = if is_test { "[RUSTC-SHIM] rustc --test" } else { "[RUSTC-SHIM] rustc" };
144146
let prefix = match crate_name {
145-
Some(crate_name) => format!("rustc {}", crate_name),
146-
None => "rustc".to_string(),
147+
Some(crate_name) => format!("{} {}", prefix, crate_name),
148+
None => prefix.to_string(),
147149
};
148150
for (i, (k, v)) in rust_env_vars.enumerate() {
149151
eprintln!("{} env[{}]: {:?}={:?}", prefix, i, k, v);
@@ -171,7 +173,6 @@ fn main() {
171173
{
172174
if let Some(crate_name) = crate_name {
173175
let dur = start.elapsed();
174-
let is_test = args.iter().any(|a| a == "--test");
175176
// If the user requested resource usage data, then
176177
// include that in addition to the timing output.
177178
let rusage_data =

0 commit comments

Comments
 (0)