about summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering/src/errors.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-02-06 04:15:41 +0000
committerbors <bors@rust-lang.org>2024-02-06 04:15:41 +0000
commitff95e52665aa6271b95b731888a4921b4f68f0b6 (patch)
tree48366ff4f1b76bd593cf1a602e41c15b191aa6cb /compiler/rustc_ast_lowering/src/errors.rs
parentf3b9d47a46c6d237665801155aa3e26c5f49958b (diff)
parent48f664b5027f5912edbbfc240f90ed439be73280 (diff)
downloadrust-ff95e52665aa6271b95b731888a4921b4f68f0b6.tar.gz
rust-ff95e52665aa6271b95b731888a4921b4f68f0b6.zip
Auto merge of #120326 - tmandry:abort-in-tests, r=cuviper
Actually abort in -Zpanic-abort-tests

When a test fails in panic=abort, it can be useful to have a debugger or other tooling hook into the `abort()` call for debugging. Doing this some other way would require it to hard code details of Rust's panic machinery.

There's no reason we couldn't have done this in the first place; using a single exit code for "success" or "failed" was just simpler. Now we are aware of the special exit codes for posix and windows platforms, logging a special error if an unrecognized code is used on those platforms, and falling back to just "failure" on other platforms.

This continues to account for `#[should_panic]` inside the test process itself, so there's no risk of misinterpreting a random call to `abort()` as an expected panic. Any exit code besides `TR_OK` is logged as a test failure.

As an added benefit, this would allow us to support panic=immediate_abort (but not `#[should_panic]`), without noise about unexpected exit codes when a test fails.
Diffstat (limited to 'compiler/rustc_ast_lowering/src/errors.rs')
0 files changed, 0 insertions, 0 deletions