Skip to content

Fix doctest output json #144908

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Aug 4, 2025

Fixes #144798.

Hopefully it will work with the new changes in libtest without needing to do both at once.

This PR moves the rustdoc merged doctest extra information directly into libtest to ensure they share the same rendering to prevent the bug uncovered in #144798.

cc @lolbinary (as you reviewed the first PR)

And since we're making changes to libtest:

r? @Amanieu

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Aug 4, 2025
@rust-log-analyzer
Copy link
Collaborator

The job pr-check-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] askama test:false 0.177
error[E0425]: cannot find function `print_merged_doctests_times` in crate `test`
   --> src/librustdoc/doctest.rs:398:23
    |
398 |                 test::print_merged_doctests_times(&test_args, total_time, compilation_time);
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in `test`

error[E0425]: cannot find function `print_merged_doctests_times` in crate `test`
   --> src/librustdoc/doctest.rs:406:15
    |
406 |         test::print_merged_doctests_times(&test_args, total_time, compilation_time);
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in `test`

For more information about this error, try `rustc --explain E0425`.
[RUSTC-TIMING] rustdoc test:false 3.559
error: could not compile `rustdoc` (lib) due to 2 previous errors

@GuillaumeGomez
Copy link
Member Author

This is very frustrating that libtest cannot be used like any other dependency. Is there a reason to that @Kobzol ?

@Kobzol
Copy link
Member

Kobzol commented Aug 4, 2025

Well, that is kind one of the outputs of the stage0 redesign. cfg(bootstrap) has moved from the stdlib to the compiler (so rustc and rustdoc). If you need to use new unstable library APIs (which includes libtest) in rustc/rustdoc, you have to support both stage0 and stage1 with cfg(bootstrap) until beta is bumped.

@GuillaumeGomez
Copy link
Member Author

Like usual, I will wait for the separate PR I opened to be merged and available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[rustdoc] Non-json time diagnostics in stdout when using --format json
5 participants