Skip to content

[rustdoc] Correctly handle output options with --show-coverage#159411

Open
GuillaumeGomez wants to merge 3 commits into
rust-lang:mainfrom
GuillaumeGomez:show-coverage
Open

[rustdoc] Correctly handle output options with --show-coverage#159411
GuillaumeGomez wants to merge 3 commits into
rust-lang:mainfrom
GuillaumeGomez:show-coverage

Conversation

@GuillaumeGomez

Copy link
Copy Markdown
Member

Fixes #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

@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-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jul 16, 2026
@rustbot

rustbot commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

camelid is currently at their maximum review capacity.
They may take a while to respond.

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

Ah, maybe @Urgau then?

r? @Urgau

@rustbot rustbot assigned Urgau and unassigned camelid Jul 16, 2026
@rust-log-analyzer

This comment has been minimized.

@Urgau

Urgau commented Jul 16, 2026

Copy link
Copy Markdown
Member

I haven't looked at the implementation, but it seems a bit weird to me to have an flag called --show-coverage that doesn't show anything when used with -o. Are we worried about confusing users?

#158929 suggests updating the documentation instead.
cc @aDotInTheVoid (in case you have an opinion)

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

I haven't looked at the implementation, but it seems a bit weird to me to have an flag called --show-coverage that doesn't show anything when used with -o. Are we worried about confusing users?

#158929 suggests updating the documentation instead. cc @aDotInTheVoid (in case you have an opinion)

If you want to generate the output in a file, that seems kinda logical to not have output on stdout.

@rust-log-analyzer

This comment has been minimized.

@Urgau

Urgau commented Jul 17, 2026

Copy link
Copy Markdown
Member

If you want to generate the output in a file, that seems kinda logical to not have output on stdout.

100% agree, but the CLI option is called --show-..., that implies (at least to me) -o - (i.e. the current behavior). Maybe we should have --coverage?

Is there a way to know if some users are currently relying on the current behavior? (since this is a breaking change)

@Urgau Urgau added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 17, 2026
@GuillaumeGomez

Copy link
Copy Markdown
Member Author

docs.rs. We could rename the option, I don't mind. But something like --doc-coverage seems better than just coverage, no?

@Urgau

Urgau commented Jul 20, 2026

Copy link
Copy Markdown
Member

Yeah, --doc-coverage seems fine. I'm mostly worried about the breaking change to --show-coverage, so if -o is respected only for this new option, that seems fine to me.

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

It's a nightly only option, so breaking changes are fine. Although in this case, as long as you don't use -o, there is no change.

@Urgau

Urgau commented Jul 21, 2026

Copy link
Copy Markdown
Member

Oh! I thought --show-coverage was stable, never-mind about the breaking change then.

Though I still think renaming it to --doc-coverage would be better.

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

A follow-up and an issue about doing it would be good since we'll need an FCP. ;)

@Urgau

Urgau commented Jul 21, 2026

Copy link
Copy Markdown
Member

Created #159691 for the rename.

@Urgau

Urgau commented Jul 21, 2026

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 1010137 has been approved by Urgau

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 21, 2026
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jul 21, 2026
[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
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jul 21, 2026
[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
rust-bors Bot pushed a commit that referenced this pull request Jul 21, 2026
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)
@jhpratt

jhpratt commented Jul 22, 2026

Copy link
Copy Markdown
Member

@bors r- #159693 (comment)

error[E0463]: can't find crate for `std`
  |
  = note: the `thumbv6m-none-eabi` target may not support the standard library
  = note: `std` is required by `<unknown>` because it does not declare `#![no_std]`
  = help: consider building the standard library from source with `cargo build -Zbuild-std`

error: cannot resolve a prelude import

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 22, 2026
@rust-bors

rust-bors Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

This PR was contained in a rollup (#159693), which was unapproved.

View changes since this unapproval

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-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler 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: --show-coverage --output-format=json doesn't respect -o, but the docs suggest it will.

6 participants