Skip to content

Merged doctest compilation time is not reported if all doctests are merged #146960

@kpreid

Description

@kpreid

I tested this code:

/// ```
/// playground::foo();
/// ```
pub fn foo() {}

I expected to see this happen: As per closed issue #144270 and PR #144308, the time spent compiling the doctests should be reported.

Instead, this happened: The compilation time is not reported (all visible timestamps are 0.00 s), unless at least one doctest in the crate is compiled separately for any reason (e.g. ```compile_fail).

Meta

rustc --version --verbose:

rustc 1.92.0-nightly (4645a7988 2025-09-17)
binary: rustc
commit-hash: 4645a7988177c286f61609cc667ecae4c571a2e8
commit-date: 2025-09-17
host: aarch64-apple-darwin
release: 1.92.0-nightly
LLVM version: 21.1.1

@rustbot label A-doctests A-libtest
cc @GuillaumeGomez

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-doctestsArea: Documentation tests, run by rustdocA-libtestArea: `#[test]` / the `test` libraryC-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions