rustdoc: Represent --output-format=json coverage and ir differently#154445
Conversation
|
r? @notriddle rustbot has assigned @notriddle. Use Why was this reviewer chosen?The reviewer was selected based on:
|
5e04d7c to
c2505e6
Compare
This comment has been minimized.
This comment has been minimized.
|
@rustbot author |
|
Assign to someone who knows more about this: r? Urgau |
|
r=me after fixing CI |
c2505e6 to
1878bf7
Compare
This comment has been minimized.
This comment has been minimized.
eb1d4fa to
9ed47c1
Compare
|
This has changed enough that it probably needs re-review. @rustbot ready |
9ed47c1 to
2b4458f
Compare
`--output-format=json` does a few different things:
- By itself, it emits a JSON representation of a crate's API ("IR
JSON").
- When used with `--show-coverage`, it prints the doc coverage as JSON,
instead of an ASCII table ("Coverage JSON").
These two cases need to be handled entirely differently. There's no
overlapping code, they just are called the same way.
By making these separate variants, we don't need to check the
`show_coverage` variable each time we check `is_json`, which makes it
harder to write a bug that checks for IR JSON, and accidentally happens in
coverage JSON too.
Also, as a driveby, improves some instability error messages, and cleans
up their tests, and adds other related tests.
2b4458f to
d2ee4ca
Compare
--output-format=json coverage and ir diferently--output-format=json coverage and ir differently
| match typ { | ||
| EmitType::DepInfo(_) => match output_format { | ||
| OutputFormat::Json | OutputFormat::Html => {} | ||
| OutputFormat::Html | OutputFormat::IrJson | OutputFormat::CoverageJson => {} |
There was a problem hiding this comment.
I don't think this is actually correct as --emit=dep-info makes no sense for --show-coverage (which only goes to stdout). I've filed #158929 to track doing this, as that fix should be a separate PR.
There was a problem hiding this comment.
Indeed this seems weird. I agree that we should probably disallow --emit=dep-info with --show-coverage.
|
@bors r+ |
rustdoc: Represent `--output-format=json` coverage and ir differently
`--output-format=json` does a few different things:
- By itself, it emits a JSON representation of a crate's API ("IR
JSON").
- When used with `--show-coverage`, it prints the doc coverage as JSON,
instead of an ASCII table ("Coverage JSON").
These two cases need to be handled entirely differently. There's no
overlapping code, they just are called the same way.
By making these separate variants, we don't need to check the
`show_coverage` variable each time we check `is_json`, which makes it
harder to write a bug that checks for IR JSON, and accidentally happens in
coverage JSON too.
Also, as a driveby, improves some instability error messages, and cleans
up their tests, and adds other related tests.
rustdoc: Represent `--output-format=json` coverage and ir differently
`--output-format=json` does a few different things:
- By itself, it emits a JSON representation of a crate's API ("IR
JSON").
- When used with `--show-coverage`, it prints the doc coverage as JSON,
instead of an ASCII table ("Coverage JSON").
These two cases need to be handled entirely differently. There's no
overlapping code, they just are called the same way.
By making these separate variants, we don't need to check the
`show_coverage` variable each time we check `is_json`, which makes it
harder to write a bug that checks for IR JSON, and accidentally happens in
coverage JSON too.
Also, as a driveby, improves some instability error messages, and cleans
up their tests, and adds other related tests.
rustdoc: Represent `--output-format=json` coverage and ir differently
`--output-format=json` does a few different things:
- By itself, it emits a JSON representation of a crate's API ("IR
JSON").
- When used with `--show-coverage`, it prints the doc coverage as JSON,
instead of an ASCII table ("Coverage JSON").
These two cases need to be handled entirely differently. There's no
overlapping code, they just are called the same way.
By making these separate variants, we don't need to check the
`show_coverage` variable each time we check `is_json`, which makes it
harder to write a bug that checks for IR JSON, and accidentally happens in
coverage JSON too.
Also, as a driveby, improves some instability error messages, and cleans
up their tests, and adds other related tests.
…uwer Rollup of 25 pull requests Successful merges: - #158871 (add relnotes for 1.97.0) - #158968 (stdarch subtree update) - #154445 (rustdoc: Represent `--output-format=json` coverage and ir differently) - #156370 (Reject linked dylib EII default overrides) - #157153 (allow `Allocator`s to be used as `#[global_allocator]`s) - #158495 (Rename HAS_CT_PROJECTION to HAS_CONST_ALIAS) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158645 (Fix splat ICEs and ban it in closures) - #158655 (Fix coroutine MIR saved local remapping) - #158666 (Carry the `b_offset` inside `BackendRepr::ScalarPair`) - #158912 (Introduce new bootstrap config section for PGO configuration) - #158920 (Update wasm-component-ld to 0.5.26) - #158926 (wrapping_sh* methods: clarify underspecified reference) - #158927 (add core test run with `-Zforce-intrinsic-fallback`) - #158932 (Do not build the compiler when invoking `x perf compare`) - #158937 (Emit the emscripten entry point as `__main_argc_argv`) - #151379 (Stabilize `VecDeque::retain_back` from `truncate_front`) - #156548 ( Library support for aarch64-unknown-linux-pauthtest target) - #158307 (CI job for parallel frontend ui tests) - #158347 (Improve generic parameters handling for #[diagnostic::on_const]) - #158722 (delegation: do not always inherit `ConstArgHasType` predicates) - #158741 (Simplify `Option::into_flat_iter` signature) - #158807 (Add regression test for CString::clone_into unwind safety) - #158862 (Fix the span for parameter suggestion ) - #158883 (tests: fix enum-match.rs to handle LLVM 23)
rustdoc: Represent `--output-format=json` coverage and ir differently
`--output-format=json` does a few different things:
- By itself, it emits a JSON representation of a crate's API ("IR
JSON").
- When used with `--show-coverage`, it prints the doc coverage as JSON,
instead of an ASCII table ("Coverage JSON").
These two cases need to be handled entirely differently. There's no
overlapping code, they just are called the same way.
By making these separate variants, we don't need to check the
`show_coverage` variable each time we check `is_json`, which makes it
harder to write a bug that checks for IR JSON, and accidentally happens in
coverage JSON too.
Also, as a driveby, improves some instability error messages, and cleans
up their tests, and adds other related tests.
Rollup of 25 pull requests Successful merges: - #158871 (add relnotes for 1.97.0) - #158968 (stdarch subtree update) - #157690 (codegen_ssa: pack small const aggregates into immediate stores) - #158541 (Move `std::io::Write` to `core::io`) - #154445 (rustdoc: Represent `--output-format=json` coverage and ir differently) - #156370 (Reject linked dylib EII default overrides) - #157153 (allow `Allocator`s to be used as `#[global_allocator]`s) - #158495 (Rename HAS_CT_PROJECTION to HAS_CONST_ALIAS) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158645 (Fix splat ICEs and ban it in closures) - #158655 (Fix coroutine MIR saved local remapping) - #158666 (Carry the `b_offset` inside `BackendRepr::ScalarPair`) - #158870 (std: merge the unix-like io::error modules into one file) - #158920 (Update wasm-component-ld to 0.5.26) - #158926 (wrapping_sh* methods: clarify underspecified reference) - #158927 (add core test run with `-Zforce-intrinsic-fallback`) - #158932 (Do not build the compiler when invoking `x perf compare`) - #158937 (Emit the emscripten entry point as `__main_argc_argv`) - #151379 (Stabilize `VecDeque::retain_back` from `truncate_front`) - #156144 (Better docs for PartialEq (includes macro rename)) - #156548 ( Library support for aarch64-unknown-linux-pauthtest target) - #158307 (CI job for parallel frontend ui tests) - #158347 (Improve generic parameters handling for #[diagnostic::on_const]) - #158722 (delegation: do not always inherit `ConstArgHasType` predicates) - #158741 (Simplify `Option::into_flat_iter` signature)
rustdoc: Represent `--output-format=json` coverage and ir differently
`--output-format=json` does a few different things:
- By itself, it emits a JSON representation of a crate's API ("IR
JSON").
- When used with `--show-coverage`, it prints the doc coverage as JSON,
instead of an ASCII table ("Coverage JSON").
These two cases need to be handled entirely differently. There's no
overlapping code, they just are called the same way.
By making these separate variants, we don't need to check the
`show_coverage` variable each time we check `is_json`, which makes it
harder to write a bug that checks for IR JSON, and accidentally happens in
coverage JSON too.
Also, as a driveby, improves some instability error messages, and cleans
up their tests, and adds other related tests.
Rollup of 23 pull requests Successful merges: - #158968 (stdarch subtree update) - #154445 (rustdoc: Represent `--output-format=json` coverage and ir differently) - #158495 (Rename HAS_CT_PROJECTION to HAS_CONST_ALIAS) - #158666 (Carry the `b_offset` inside `BackendRepr::ScalarPair`) - #158870 (std: merge the unix-like io::error modules into one file) - #158920 (Update wasm-component-ld to 0.5.26) - #158926 (wrapping_sh* methods: clarify underspecified reference) - #158927 (add core test run with `-Zforce-intrinsic-fallback`) - #158932 (Do not build the compiler when invoking `x perf compare`) - #158937 (Emit the emscripten entry point as `__main_argc_argv`) - #151379 (Stabilize `VecDeque::retain_back` from `truncate_front`) - #156144 (Better docs for PartialEq (includes macro rename)) - #156548 ( Library support for aarch64-unknown-linux-pauthtest target) - #157995 (`Vec::dedup_by` docs explicit function argument order) - #158307 (CI job for parallel frontend ui tests) - #158741 (Simplify `Option::into_flat_iter` signature) - #158807 (Add regression test for CString::clone_into unwind safety) - #158862 (Fix the span for parameter suggestion ) - #158894 (Make the ordering of non-terminal binds in ambiguity error messages deterministic) - #158902 (add codegen test for range length bound propagation) - #158913 (Update `browser-ui-test` version to `0.24.1`) - #158935 (std: support real fd methods on Emscripten) - #158978 (Add regression test for too-big by-value ABI args)
Rollup merge of #154445 - aDotInTheVoid:better-enum, r=Urgau rustdoc: Represent `--output-format=json` coverage and ir differently `--output-format=json` does a few different things: - By itself, it emits a JSON representation of a crate's API ("IR JSON"). - When used with `--show-coverage`, it prints the doc coverage as JSON, instead of an ASCII table ("Coverage JSON"). These two cases need to be handled entirely differently. There's no overlapping code, they just are called the same way. By making these separate variants, we don't need to check the `show_coverage` variable each time we check `is_json`, which makes it harder to write a bug that checks for IR JSON, and accidentally happens in coverage JSON too. Also, as a driveby, improves some instability error messages, and cleans up their tests, and adds other related tests.
--output-format=jsondoes a few different things:JSON").
--show-coverage, it prints the doc coverage as JSON,instead of an ASCII table ("Coverage JSON").
These two cases need to be handled entirely differently. There's no
overlapping code, they just are called the same way.
By making these separate variants, we don't need to check the
show_coveragevariable each time we checkis_json, which makes itharder to write a bug that checks for IR JSON, and accidentally happens in
coverage JSON too.
Also, as a driveby, improves some instability error messages, and cleans
up their tests, and adds other related tests.