Skip to content

Commit

Permalink
Rollup merge of rust-lang#100339 - shourya5:issue#100258, r=jyn514
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
compiler-errors authored Aug 10, 2022
2 parents eae824d + 0d8bcc3 commit f0fdc46
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit f0fdc46

Please sign in to comment.