-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #98994 - kons-9:dont_use_process_exit, r=jyn514
replace process exit with more detailed exit in src/bootstrap/*.rs Fixes [#98830](#98830) I implemeted "detail_exit.rs" in lib.rs, and replace all of std::process::exit. So, error code should panic in test code. ``` // lib.rs pub fn detail_exit(code: i32) -> ! { // Successful exit if code == 0 { std::process::exit(0); } if cfg!(test) { panic!("status code: {}", code); } else { std::panic::resume_unwind(Box::new(code)); } } ``` <details> <summary>% rg "exit\(" src/bootstrap/*.rs</summary> ``` builder.rs 351: crate::detail_exit(1); 1000: crate::detail_exit(1); 1429: crate::detail_exit(1); compile.rs 1331: crate::detail_exit(1); config.rs 818: crate::detail_exit(2); 1488: crate::detail_exit(1); flags.rs 263: crate::detail_exit(exit_code); 349: crate::detail_exit(exit_code); 381: crate::detail_exit(1); 602: crate::detail_exit(1); 616: crate::detail_exit(1); 807: crate::detail_exit(1); format.rs 35: crate::detail_exit(1); 117: crate::detail_exit(1); lib.rs 714: detail_exit(1); 1620: detail_exit(1); 1651:pub fn detail_exit(code: i32) -> ! { 1654: std::process::exit(0); sanity.rs 107: crate::detail_exit(1); setup.rs 97: crate::detail_exit(1); 290: crate::detail_exit(1); test.rs 676: crate::detail_exit(1); 1024: crate::detail_exit(1); 1254: crate::detail_exit(1); tool.rs 207: crate::detail_exit(1); toolstate.rs 96: crate::detail_exit(3); 111: crate::detail_exit(1); 182: crate::detail_exit(1); 228: crate::detail_exit(1); util.rs 339: crate::detail_exit(1); 378: crate::detail_exit(1); 468: crate::detail_exit(1); ``` </details>
- Loading branch information
Showing
12 changed files
with
48 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters