In the docs for --show-coverage --output-format=json we say:
If you want the JSON output to be displayed on stdout instead of having a file generated, you can
use -o -.
-- https://github.com/rust-lang/rust/blob/f10db292a3733b5c67c8da8c7661195ff4b05774/src/doc/rustdoc/src/unstable-features.md#json-output
This is true!
$ rustdoc +nightly ./lol.rs --show-coverage --output-format=json -Zunstable-options -o -
{"./lol.rs":{"total":2,"with_docs":0,"total_examples":1,"with_examples":0}}
But if you use -o file.json it still prints to stdout:
$ rustdoc +nightly ./lol.rs --show-coverage --output-format=json -Zunstable-options -o file.json
{"./lol.rs":{"total":2,"with_docs":0,"total_examples":1,"with_examples":0}}
$ ls
lol.rs
In fact, rustdoc always prints to stdout, and the -o flag does nothing:
|
fn print_results(&self) { |
|
let output_format = self.ctx.output_format; |
|
// In this case we want to ensure that the `OutputFormat` is JSON and NOT the `DocContext`. |
|
if output_format.is_json() { |
|
println!("{}", self.to_json()); |
|
return; |
|
} |
The docs should be updated to be clear about this.
Also, maybe --emit=dep-info shouldn't be supported when using --show-coverage, and there's no "output file" to speak of.
In the docs for
--show-coverage --output-format=jsonwe say:-- https://github.com/rust-lang/rust/blob/f10db292a3733b5c67c8da8c7661195ff4b05774/src/doc/rustdoc/src/unstable-features.md#json-output
This is true!
But if you use
-o file.jsonit still prints to stdout:In fact, rustdoc always prints to stdout, and the
-oflag does nothing:rust/src/librustdoc/passes/calculate_doc_coverage.rs
Lines 132 to 138 in f10db29
The docs should be updated to be clear about this.
Also, maybe
--emit=dep-infoshouldn't be supported when using--show-coverage, and there's no "output file" to speak of.