diff --git a/collector/src/rustc-fake.rs b/collector/src/rustc-fake.rs index b92d6c8a1..5c89d174f 100644 --- a/collector/src/rustc-fake.rs +++ b/collector/src/rustc-fake.rs @@ -467,8 +467,9 @@ fn process_self_profile_output(prof_out_dir: PathBuf, args: &[OsString]) { #[cfg(windows)] fn exec(cmd: &mut Command) { let cmd_d = format!("{:?}", cmd); - if let Err(e) = cmd.status() { - panic!("failed to execute `{}`: {}", cmd_d, e); + match cmd.status() { + Ok(status) => std::process::exit(status.code().unwrap_or(1)), + Err(e) => panic!("failed to spawn `{}`: {}", cmd_d, e), } }