about summary refs log tree commit diff
path: root/src/bootstrap/lib.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-08-10 18:05:34 +0000
committerbors <bors@rust-lang.org>2022-08-10 18:05:34 +0000
commit7bc32faebcfacb96be73650e624dc94e330298ab (patch)
tree96eb6c6ef5d76613c4a499759280f06b03c2b838 /src/bootstrap/lib.rs
parentc7ff1e8b0090b4ca3d62edef3dc2421861d57c48 (diff)
parenteff71b9927a98900ace67494fb9b1cb45a3b80a5 (diff)
downloadrust-7bc32faebcfacb96be73650e624dc94e330298ab.tar.gz
rust-7bc32faebcfacb96be73650e624dc94e330298ab.zip
Auto merge of #100378 - compiler-errors:rollup-8vzsd92, r=compiler-errors
Rollup of 8 pull requests

Successful merges:

 - #100286 (Add support for link-flavor rust-lld for macOS)
 - #100317 (Remove logic related to deprecated nvptx-nvidia-cuda (32-bit) target)
 - #100339 (Fixes bootstrap panic when running x fmt --check )
 - #100348 (Add regression test for #93205)
 - #100349 (Refactor: remove a type string comparison)
 - #100353 (Fix doc links in core::time::Duration::as_secs)
 - #100359 (Special-case references to leafs in valtree pretty-printing)
 - #100371 (Inline CStr::from_bytes_with_nul_unchecked::rt_impl)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/bootstrap/lib.rs')
-rw-r--r--src/bootstrap/lib.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index f84de73297a..a242243aaaf 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -1631,14 +1631,12 @@ fn chmod(_path: &Path, _perms: u32) {}
 /// If code is not 0 (successful exit status), exit status is 101 (rust's default error code.)
 /// If the test is running and code is an error code, it will cause a panic.
 fn detail_exit(code: i32) -> ! {
-    // Successful exit
-    if code == 0 {
-        std::process::exit(0);
-    }
-    if cfg!(test) {
+    // if in test and code is an error code, panic with staus code provided
+    if cfg!(test) && code != 0 {
         panic!("status code: {}", code);
     } else {
-        std::panic::resume_unwind(Box::new(code));
+        //otherwise,exit with provided status code
+        std::process::exit(code);
     }
 }