-
-
Notifications
You must be signed in to change notification settings - Fork 15k
-Z panic_abort_tests does not support #[bench] #103261
Copy link
Copy link
Closed as not planned
Labels
A-libtestArea: `#[test]` / the `test` libraryArea: `#[test]` / the `test` libraryT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Metadata
Metadata
Assignees
Labels
A-libtestArea: `#[test]` / the `test` libraryArea: `#[test]` / the `test` libraryT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Type
Fields
Give feedbackNo fields configured for issues without a type.
If we try to run a test binary built with
-Z panic-abort-testsand that test has a function with the#[bench]attribute, the binary will panic with the following error:thread 'main' panicked at 'Cannot run dynamic test fn out-of-process', library/test/src/lib.rs:549:22This is because we convert
#[bench]to a test usingDynTestFnwhen not running benchmarks, butDynTestFnis not supported with-Z panic-abort-tests, because we must run tests out of process and don't have a way to pass a closure to another process.