about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-07-27 16:21:09 +0000
committerbors <bors@rust-lang.org>2020-07-27 16:21:09 +0000
commitefc02b03d18b0cbaa55b1e421d792f70a39230b2 (patch)
tree21b936024aa6b6c6b232b3f3448247be51d889f0 /src/bootstrap
parent4a90e36c85336d1d4b209556c1a9733210bbff19 (diff)
parent539ba96c1859111a200bdd6fb12c91bcee76f34b (diff)
downloadrust-efc02b03d18b0cbaa55b1e421d792f70a39230b2.tar.gz
rust-efc02b03d18b0cbaa55b1e421d792f70a39230b2.zip
Auto merge of #74831 - Manishearth:rollup-ugw4pt4, r=Manishearth
Rollup of 4 pull requests

Successful merges:

 - #73858 (Make more primitive integer methods const)
 - #74487 (Forbid generic parameters in anon consts inside of type defaults)
 - #74803 (rustbuild: fix bad usage of UNIX exec() in rustc wrapper)
 - #74822 (More ensure stack to avoid segfault with increased `recursion_limit`)

Failed merges:

r? @ghost
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/bin/rustc.rs13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs
index fd36cd9bd8b..af75faf698e 100644
--- a/src/bootstrap/bin/rustc.rs
+++ b/src/bootstrap/bin/rustc.rs
@@ -153,7 +153,7 @@ fn main() {
             e => e,
         };
         println!("\nDid not run successfully: {:?}\n{:?}\n-------------", e, cmd);
-        exec_cmd(&mut on_fail).expect("could not run the backup command");
+        status_code(&mut on_fail).expect("could not run the backup command");
         std::process::exit(1);
     }
 
@@ -182,17 +182,10 @@ fn main() {
         }
     }
 
-    let code = exec_cmd(&mut cmd).unwrap_or_else(|_| panic!("\n\n failed to run {:?}", cmd));
+    let code = status_code(&mut cmd).unwrap_or_else(|_| panic!("\n\n failed to run {:?}", cmd));
     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 status_code(cmd: &mut Command) -> io::Result<i32> {
     cmd.status().map(|status| status.code().unwrap())
 }