Code
Reproduction Steps
$ rustdoc --crate-name lib -Zunstable-options --output-format=json --emit=dep-info=lib.d lib.rs -o out
$ echo $?
0
$ ls lib.d
lib.d
$ ls out/lib.json
ls: out/lib.json: No such file or directory
Related cases:
$ rustdoc --crate-name lib -Zunstable-options --output-format=json --emit=html-static-files,dep-info=lib.d lib.rs -o out
error: the `--emit=html-static-files` flag is not supported with `--output-format=json`
$ rustdoc --crate-name lib -Zunstable-options --output-format=json --emit=json-files lib.rs -o out
error: unrecognized emission type: json-files
Expected Outcome
A way to request the dep-info file and the JSON doc output in one invocation.
For example, making the json-files emission type nameable on CLI
(I knew #155679 made it non-nameable), like hte following:
$ rustdoc --output-format=json --emit=json-files,dep-info=lib.d lib.rs -o out
$ ls out/lib.json lib.d
out/lib.json lib.d
This was found in rust-lang/cargo#17020
that Cargo wants a better rebuild detection also for JSON output.
At minimum,
an explicit --emit in JSON mode that omits the JSON output
should not exit 0 while silently skipping the primary artifact
Actual Output
$ rustdoc --output-format=json --emit=dep-info=lib.d lib.rs -o out
# exit=0
# no out/lib.json produced
# dep-info was produced
Version
rustdoc 1.99.0-nightly (3659db0d3 2026-07-05)
Code
Reproduction Steps
Related cases:
Expected Outcome
A way to request the dep-info file and the JSON doc output in one invocation.
For example, making the
json-filesemission type nameable on CLI(I knew #155679 made it non-nameable), like hte following:
This was found in rust-lang/cargo#17020
that Cargo wants a better rebuild detection also for JSON output.
At minimum,
an explicit
--emitin JSON mode that omits the JSON outputshould not exit 0 while silently skipping the primary artifact
Actual Output
Version
rustdoc 1.99.0-nightly (3659db0d3 2026-07-05)