rustbuild: fix bad usage of UNIX exec() in rustc wrapper

exec never returns, it replaces the current process. so anything after it is
unreachable. that's not how exec_cmd() is used in the surrounding code
This commit is contained in:
Ximin Luo 2020-07-27 02:42:02 +01:00
parent c70986264b
commit 0cf17e750d

View File

@ -186,13 +186,6 @@ fn main() {
std::process::exit(code); std::process::exit(code);
} }
#[cfg(unix)]
fn exec_cmd(cmd: &mut Command) -> io::Result<i32> {
use std::os::unix::process::CommandExt;
Err(cmd.exec())
}
#[cfg(not(unix))]
fn exec_cmd(cmd: &mut Command) -> io::Result<i32> { fn exec_cmd(cmd: &mut Command) -> io::Result<i32> {
cmd.status().map(|status| status.code().unwrap()) cmd.status().map(|status| status.code().unwrap())
} }