You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ rustdoc --crate-name lib -Zunstable-options --output-format=json --emit=dep-info=lib.d lib.rs -o out
$ echo$?0
$ ls lib.dlib.d
$ ls out/lib.jsonls: 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 outerror: 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 outerror: 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.dout/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
Activity
weihanglo commentedon Jul 6, 2026
I haven't looked at a possible fix. Willing to try a fix if you folks think the expected outcome is reasonable.
cc @fmease (since you wrote #155679)