Skip to content

rustdoc: Tracking issue for command-line flag --test-builder #102981

Open

Description

@ojeda

FIXME: Write a proper synopsis.

Original description

The flag was added in the second commit of #64328, but I couldn't find a tracking issue (like #87022 for --no-run).

Is it meant to be stabilized?

  • If yes: please feel free to reuse this as the tracking issue like in the --no-run one.
  • If not: we are currently using it (together with --no-run) in the kernel to extract the source code of the tests, i.e. to achieve something similar to --persist-doctests, but for source code; or like --scrape-examples, but for doctests. Would there be a better/stable way to do that?

In the PR above [@]Mark-Simulacrum mentions:

This is largely intended for "advanced" users at this point (I'm not sure if we'll ever stabilize it)

[@]GuillaumeGomez

Note

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.

A tracking issue is however not meant for large scale discussion, questions, or bug reports.
Instead, open a dedicated issue for the specific matter or post in the #t-rustdoc Zulip channel.

Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.

Steps

  • Implementation PR
  • Stabilization PR

Implementation history

Activity

  1. added
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    on Oct 12, 2022
  2. GuillaumeGomez commented on Oct 12, 2022

    @GuillaumeGomez
    Member

    I don't think it was intended for being stabilized.

  3. Mark-Simulacrum commented on Oct 12, 2022

    @Mark-Simulacrum
    Member

    That PR tried to make it unstable (see the call to unstable in lib.rs), so we should track down the gap or PR that stabilized it.

  4. changed the title [-]rustdoc: Tracking Issue for `--test-builder`?[/-] [+]Tracking Issue for rustdoc `--test-builder`[/+] on Jan 23, 2023
  5. added
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    S-tracking-perma-unstableStatus: The feature will stay unstable indefinitely.
    on Jan 23, 2023
  6. aDotInTheVoid commented on Nov 18, 2024

    @aDotInTheVoid
    Member

    Relevent zulip discussion on rust-for-linux's use of this to enable running doctests in kernelspace.

  7. added a commit that references this issue on Nov 19, 2024
  8. added a commit that references this issue on Nov 19, 2024
  9. added
    B-unstableBlocker: Implemented in the nightly compiler and unstable.
    A-CLIArea: Command-line interface (CLI) to the compiler
    A-doctestsArea: Documentation tests, run by rustdoc
    on Oct 10, 2025
  10. added
    A-rust-for-linuxRelevant for the Rust-for-Linux project
    and removed
    A-rust-for-linuxRelevant for the Rust-for-Linux project
    on Oct 10, 2025
  11. changed the title [-]Tracking Issue for rustdoc `--test-builder`[/-] [+]rustdoc: Tracking issue for command-line flag `--test-builder`[/+] on Oct 10, 2025
  12. Fethbita commented on Oct 15, 2025

    @Fethbita

    When running --test-builder without a runnable executable, the compiler panics and prints an error like so:

    error: the compiler unexpectedly panicked. this is a bug.
    
    note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-rustdoc&template=ice.md
    
    note: please make sure that you have updated to the latest nightly
    
    note: please attach the file at `/home/user/project/rustc-ice-2025-10-15T19_01_47-228736.txt` to your bug report
    
    note: compiler flags: --crate-type lib -C embed-bitcode=no -Z unstable-options
    

    Command was found and ran from #56232 (comment) but I had forgotten to chmod +x the script.

    RUSTDOCFLAGS="--test-builder asdf -Z unstable-options" cargo +nightly test --doc
    
  13. added 2 commits that reference this issue on Nov 6, 2025
  14. added a commit that references this issue on Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-CLIArea: Command-line interface (CLI) to the compilerA-doctestsArea: Documentation tests, run by rustdocB-unstableBlocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-perma-unstableStatus: The feature will stay unstable indefinitely.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions