-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--message-format json
doesn't apply to rustdoc coverage output
#75135
Comments
Yeah it's part of a larger problem. For example, rustdoc also doesn't pass on json params to the sub compiler invocations it performs when doing doctests. And it has a bunch of Edit: wait, my comment was about |
|
@est31 well, uh, it's a bit complicated now, |
This seems like a cargo bug, it should propagate the flag to rustdoc.
I'm not sure what |
It does, but as @GuillaumeGomez mentioned (and expanded on on discord iirc) the coverage output is treated as an "output artifact" not an "error message" so obeys the
Overall this issue might be a "works as designed", users should just be using |
Ok, but that seems to me like cargo should also be propagating
That doesn't seem right - when you pass |
That wouldn't be appropriate for other outputs of Does rustdoc or rustc have any other similar user facing output via |
The closest I found was
It seems reasonable to have one but not the other though - show the coverage as JSON, but if there's an error, pretty-print it for the user. I did something like that with Actually now that I say that, I think the right behavior is for cargo to pass |
I tried this:
RUSTDOCFLAGS='--show-coverage -Z unstable-options' cargo doc --message-format json --no-deps --all-features
I expected to get a json message containing the coverage information, but instead I still got a table.
Then I tried this:
RUSTDOCFLAGS='--show-coverage -Z unstable-options --output-format json' cargo doc --no-deps --all-features
and it did output a json message, but that message is missing a
reason
key to identify it within the greater message stream when combined with--message-format json
.The text was updated successfully, but these errors were encountered: