about summary refs log tree commit diff
diff options
context:
space:
mode:
authorXimin Luo <infinity0@pwned.gg>2020-07-27 02:42:02 +0100
committerXimin Luo <infinity0@pwned.gg>2020-07-27 02:43:47 +0100
commit0cf17e750d7790e0f2fc1fb184b6f917f55462ca (patch)
treee5709ad71dd3dc96b69328728f13c6cf9e4628a7
parentc70986264b4d534e35992fc64ecd9139700b5071 (diff)
downloadrust-0cf17e750d7790e0f2fc1fb184b6f917f55462ca.tar.gz
rust-0cf17e750d7790e0f2fc1fb184b6f917f55462ca.zip
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
-rw-r--r--src/bootstrap/bin/rustc.rs7
1 files changed, 0 insertions, 7 deletions
diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs
index fd36cd9bd8b..c8ee4cb0cd2 100644
--- a/src/bootstrap/bin/rustc.rs
+++ b/src/bootstrap/bin/rustc.rs
@@ -186,13 +186,6 @@ fn main() {
     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> {
     cmd.status().map(|status| status.code().unwrap())
 }