-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Support panic=abort without #[should_panic] from libtest #62318
Copy link
Copy link
Closed
Labels
A-libtestArea: `#[test]` / the `test` libraryArea: `#[test]` / the `test` libraryC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.Relevant to the dev-tools subteam, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language team
Metadata
Metadata
Assignees
Labels
A-libtestArea: `#[test]` / the `test` libraryArea: `#[test]` / the `test` libraryC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.Relevant to the dev-tools subteam, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language team
Type
Fields
Give feedbackNo fields configured for issues without a type.
When a project wants to turn on
panic=aborttoday, they are forced to choose betweenpanic=unwindfor 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=abortfrom 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