Support panic=abort without #[should_panic] from libtest #62318
Labels
A-libtest
Area: `#[test]` / the `test` library
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-dev-tools
Relevant to the dev-tools subteam, which will review and decide on the PR/issue.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
When a project wants to turn on
panic=abort
today, they are forced to choose betweenpanic=unwind
for the purpose of running tests (this not only creates longer build times, but also changes the behavior of code between testing and production)Neither of these solutions are great. One solution that might be palatable is to support compiling
panic=abort
from libtest, but not support#[should_panic]
tests in this mode. This could be advertised with an explicit error message anytime a test with#[should_panic]
is run. Later, these could be supported as "death tests" as discussed in #32512.In Fuchsia we'd really like to switch to
panic=abort
, and this is the main thing preventing us from doing so.cc @cramertj @petrhosek
The text was updated successfully, but these errors were encountered: