Rollup merge of #100339 - shourya5:issue#100258, r=jyn514
Fixes bootstrap panic when running x fmt --check closes #100258 wherein bootstrap panics when running x fmt --check. Fixed by replacing resume_unwind in #98994. with process::exit.
This commit is contained in:
commit
f0fdc464be
1 changed files with 4 additions and 6 deletions
|
@ -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 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.
|
/// If the test is running and code is an error code, it will cause a panic.
|
||||||
fn detail_exit(code: i32) -> ! {
|
fn detail_exit(code: i32) -> ! {
|
||||||
// Successful exit
|
// if in test and code is an error code, panic with staus code provided
|
||||||
if code == 0 {
|
if cfg!(test) && code != 0 {
|
||||||
std::process::exit(0);
|
|
||||||
}
|
|
||||||
if cfg!(test) {
|
|
||||||
panic!("status code: {}", code);
|
panic!("status code: {}", code);
|
||||||
} else {
|
} else {
|
||||||
std::panic::resume_unwind(Box::new(code));
|
//otherwise,exit with provided status code
|
||||||
|
std::process::exit(code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue