Skip to content

-Z panic_abort_tests does not support #[bench] #103261

Closed as not planned
Closed as not planned
@tmandry

Description

@tmandry

If we try to run a test binary built with -Z panic-abort-tests and 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:22

This is because we convert #[bench] to a test using DynTestFn when not running benchmarks, but DynTestFn is 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-libtestArea: `#[test]` / the `test` libraryT-libsRelevant to the library team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions