Rustdoc rejects html emits with json output#154421
Rustdoc rejects html emits with json output#154421rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Conversation
|
r? @camelid rustbot has assigned @camelid. Use Why was this reviewer chosen?The reviewer was selected based on:
|
src/librustdoc/config.rs
Outdated
| } | ||
| } | ||
|
|
||
| if !show_coverage && output_format == OutputFormat::Json { |
There was a problem hiding this comment.
Could you also add a test that with --emit=html-non-static-files --show-coverage --output-format=json is accepted.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
I think the old code here may want to report an error for this scenario: https://github.com/chenyukang/rust/blob/8b98b7986dca9503cea402eada2e0c6a7f5fa32e/src/librustdoc/config.rs#L503-L509
There was a problem hiding this comment.
Ah yes, I forgot that --show-coverage means we don't emit HTML output.
There was a problem hiding this comment.
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.
|
@rustbot author |
8b98b79 to
f39229d
Compare
f39229d to
7e95a22
Compare
|
@bors r+ rollup Thanks! |
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`)
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`)
Fixes #154395