[rustdoc] Correctly handle output options with --show-coverage#159411
[rustdoc] Correctly handle output options with --show-coverage#159411GuillaumeGomez wants to merge 6 commits into
Conversation
|
|
This comment has been minimized.
This comment has been minimized.
|
I haven't looked at the implementation, but it seems a bit weird to me to have an flag called #158929 suggests updating the documentation instead. |
e124008 to
f9abe70
Compare
If you want to generate the output in a file, that seems kinda logical to not have output on stdout. |
This comment has been minimized.
This comment has been minimized.
100% agree, but the CLI option is called Is there a way to know if some users are currently relying on the current behavior? (since this is a breaking change) |
|
|
f9abe70 to
1010137
Compare
|
Yeah, |
|
It's a nightly only option, so breaking changes are fine. Although in this case, as long as you don't use |
|
Oh! I thought Though I still think renaming it to |
|
A follow-up and an issue about doing it would be good since we'll need an FCP. ;) |
|
Created #159691 for the rename. |
|
@bors r+ |
[rustdoc] Correctly handle output options with --show-coverage Fixes rust-lang#158929. The `-o` option was ignored with `--show-coverage`. This PR takes it into account and makes it closer to how these options are handled in the rest of rustdoc. Considering `calculate_doc_coverage` was never really a pass and that I needed `RenderOptions` (for the `-o` option), I moved it out of passes. r? @camelid
[rustdoc] Correctly handle output options with --show-coverage Fixes rust-lang#158929. The `-o` option was ignored with `--show-coverage`. This PR takes it into account and makes it closer to how these options are handled in the rest of rustdoc. Considering `calculate_doc_coverage` was never really a pass and that I needed `RenderOptions` (for the `-o` option), I moved it out of passes. r? @camelid
Rollup of 12 pull requests Successful merges: - #159582 (Sync from portable simd 2026 07 20) - #158890 (Fix splat v0 mangling) - #159411 ([rustdoc] Correctly handle output options with --show-coverage) - #159647 (Remove `early_exit` closures) - #159656 (define a `Simd` type in `minicore`) - #156474 (Add paths for linked associated items) - #159211 (Fix debuginfo argument when invoking LLBC linker) - #159527 (Bring runtime symbols statics on par with foreign functions) - #159625 (Refactor is_opsem_inhabited) - #159652 (Remove `cfg(not(no_global_oom_handling))` from the `Drop` impl of `UniqueArcUninit`) - #159657 (Remove the blanket `#![cfg_attr(test, allow(unused))]` from bootstrap ) - #159663 (Add layout cycle hang regression test)
|
|
This pull request was unapproved. This PR was contained in a rollup (#159693), which was unapproved. |
| +-------------------------------------+------------+------------+------------+------------+ | ||
| | Total | 5 | 71.4% | 0 | 0.0% | | ||
| +-------------------------------------+------------+------------+------------+------------+ | ||
| Generated output into "$TEST_BUILD_DIR/allow_missing_docs.txt" |
There was a problem hiding this comment.
This makes all the coverage tests not actually check that the output numbers are correct.
There was a problem hiding this comment.
I completely missed it. Gonna add -o - for these tests to ensure they keep the stdout check.
There was a problem hiding this comment.
Ok fixed, thanks again!
There was a problem hiding this comment.
This should update the docs to explain what the file name will be. And that stdout is the default. Right now rustdoc foo.rs --show-coverage -o foocov.txt will make foocov.txt/foo.txt, which isn't clear for the docs. (Eventually something like #149365 could help alot here).
Also, this should add a test for --emit=dep-info, for both explicit stdout and implict stdout and explicit file cases.
| if show_coverage { | ||
| // if we ran coverage, bail early, we don't need to also generate docs at this point | ||
| // (also we didn't load in any of the useful passes) | ||
| return; | ||
| } | ||
|
|
||
| cache.crate_version = crate_version; |
There was a problem hiding this comment.
It's likely a remain when I was testing things around. Although considering we only need to set this information after the return in the if show_coverage block just above, I guess it's fine.
7cdcfc9 to
06541f4
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
06541f4 to
870e2b4
Compare
870e2b4 to
854bbe7
Compare
dd6c877 to
50ce562
Compare
True, in the meantime, added the information in the book. Also to be noted, in case
That seems unrelated to this PR, no? |
50ce562 to
c680b50
Compare
Previously, the coverage always went to stdout, so there was no meaningful deps-file to generate. Now that there’s a coverage output, it should depend on all the sources rustdoc read. If that’s not solved in this PR, there should at least be an issue opened to track it. |
View all comments
Fixes #158929.
The
-ooption was ignored with--show-coverage. This PR takes it into account and makes it closer to how these options are handled in the rest of rustdoc.Considering
calculate_doc_coveragewas never really a pass and that I neededRenderOptions(for the-ooption), I moved it out of passes.r? @camelid