Skip to content

Rustdoc rejects html emits with json output#154421

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
chenyukang:yukang-fix-154395-rustdoc-json-emit-conflict
Mar 28, 2026
Merged

Rustdoc rejects html emits with json output#154421
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
chenyukang:yukang-fix-154395-rustdoc-json-emit-conflict

Conversation

@chenyukang
Copy link
Copy Markdown
Member

@chenyukang chenyukang commented Mar 26, 2026

Fixes #154395

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Mar 26, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 26, 2026

r? @camelid

rustbot has assigned @camelid.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: rustdoc
  • rustdoc expanded to 9 candidates
  • Random selection from GuillaumeGomez, camelid, fmease, lolbinarycat, notriddle

Copy link
Copy Markdown
Member

@aDotInTheVoid aDotInTheVoid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Looks good otherwise.

View changes since this review

}
}

if !show_coverage && output_format == OutputFormat::Json {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add a test that with --emit=html-non-static-files --show-coverage --output-format=json is accepted.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems --emit=html-non-static-files --show-coverage --output-format=json also meaningless, it's better to remove the check !show_coverage in this if condition?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, I forgot that --show-coverage means we don't emit HTML output.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from unit test tests/rustdoc-ui/show-coverage-json.rs, we expect --show-coverage --output-format=json can be work together. I think it's better to report fatal error for --show-coverage --emit=html-non-static-files --output-format=json.

I updated the code and tests.

@aDotInTheVoid aDotInTheVoid self-assigned this Mar 26, 2026
@aDotInTheVoid
Copy link
Copy Markdown
Member

@rustbot author

@rustbot rustbot 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 Mar 26, 2026
@chenyukang chenyukang force-pushed the yukang-fix-154395-rustdoc-json-emit-conflict branch from 8b98b79 to f39229d Compare March 27, 2026 00:58
@chenyukang chenyukang force-pushed the yukang-fix-154395-rustdoc-json-emit-conflict branch from f39229d to 7e95a22 Compare March 27, 2026 01:00
@aDotInTheVoid
Copy link
Copy Markdown
Member

@bors r+ rollup

Thanks!

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Mar 27, 2026

📌 Commit 7e95a22 has been approved by aDotInTheVoid

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 Mar 27, 2026
rust-bors bot pushed a commit that referenced this pull request Mar 27, 2026
Rollup of 10 pull requests

Successful merges:

 - #154070 (Unstable book options parser)
 - #154371 (Use LocalDefId for more tcx method calls)
 - #154405 (Improve doc comment unicode guidance)
 - #154431 (Avoid ICE in explicit reference cast suggestion for unrelated leaf pr…)
 - #153528 (Fix LegacyKeyValueFormat report from docker build: mips)
 - #154246 (Add test for issue #101532: dead code warnings in const _)
 - #154421 (Rustdoc rejects html emits with json output)
 - #154428 (bootstrap: `-Zjson-target-spec` for synthetic targets)
 - #154437 (bootstrap.example.toml: Hint how to allow `build.warnings`)
 - #154454 (fix: [rustfmt] prevent panic when rewritng associated item delegations)

Failed merges:

 - #154450 (Use the normal arg-parsing machinery for `-Zassert-incr-state`)
rust-bors bot pushed a commit that referenced this pull request Mar 27, 2026
Rollup of 10 pull requests

Successful merges:

 - #154070 (Unstable book options parser)
 - #154371 (Use LocalDefId for more tcx method calls)
 - #154405 (Improve doc comment unicode guidance)
 - #154431 (Avoid ICE in explicit reference cast suggestion for unrelated leaf pr…)
 - #153528 (Fix LegacyKeyValueFormat report from docker build: mips)
 - #154246 (Add test for issue #101532: dead code warnings in const _)
 - #154421 (Rustdoc rejects html emits with json output)
 - #154428 (bootstrap: `-Zjson-target-spec` for synthetic targets)
 - #154437 (bootstrap.example.toml: Hint how to allow `build.warnings`)
 - #154454 (fix: [rustfmt] prevent panic when rewritng associated item delegations)

Failed merges:

 - #154450 (Use the normal arg-parsing machinery for `-Zassert-incr-state`)
@rust-bors rust-bors bot merged commit 20f9361 into rust-lang:main Mar 28, 2026
11 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 28, 2026
rust-timer added a commit that referenced this pull request Mar 28, 2026
Rollup merge of #154421 - chenyukang:yukang-fix-154395-rustdoc-json-emit-conflict, r=aDotInTheVoid

Rustdoc rejects html emits with json output

Fixes #154395
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

Reject --emit=html-* when using --output-format=json

4 participants