Skip to content

Commit

Permalink
added some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
shourya5 committed Aug 9, 2022
1 parent 9e55310 commit 0d8bcc3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1631,10 +1631,11 @@ 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 in test and code is an error code, panic with staus code provided
if cfg!(test) && code != 0 {
panic!("status code: {}", code);
} else {
//otherwise,exit with provided status code
std::process::exit(code);
}
}
Expand Down

0 comments on commit 0d8bcc3

Please sign in to comment.