Skip to content

Commit f0fdc46

Browse files
Rollup merge of rust-lang#100339 - shourya5:issue#100258, r=jyn514
Fixes bootstrap panic when running x fmt --check closes rust-lang#100258 wherein bootstrap panics when running x fmt --check. Fixed by replacing resume_unwind in rust-lang#98994. with process::exit.
2 parents eae824d + 0d8bcc3 commit f0fdc46

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Diff for: src/bootstrap/lib.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -1631,14 +1631,12 @@ fn chmod(_path: &Path, _perms: u32) {}
16311631
/// If code is not 0 (successful exit status), exit status is 101 (rust's default error code.)
16321632
/// If the test is running and code is an error code, it will cause a panic.
16331633
fn detail_exit(code: i32) -> ! {
1634-
// Successful exit
1635-
if code == 0 {
1636-
std::process::exit(0);
1637-
}
1638-
if cfg!(test) {
1634+
// if in test and code is an error code, panic with staus code provided
1635+
if cfg!(test) && code != 0 {
16391636
panic!("status code: {}", code);
16401637
} else {
1641-
std::panic::resume_unwind(Box::new(code));
1638+
//otherwise,exit with provided status code
1639+
std::process::exit(code);
16421640
}
16431641
}
16441642

0 commit comments

Comments
 (0)