Open jotare opened 1 year ago
Thanks for the report! This appears to be an issue with rustdoc, and its issue tracker lives here.
Putting doc(hidden)
on the entire crate is ... a very strange decision. I am not sure what the semantics of that should be.
The use case is a library with private documentation published to crates.io.
What does this mean? docs.rs intentionally does not have an opt-out mechanism: https://github.com/rust-lang/docs.rs/issues/125
Thanks for the quick reply!
Putting
doc(hidden)
on the entire crate is ... a very strange decision. I am not sure what the semantics of that should be.
Yes, I also think so. In my opinion, an empty docs page (or something similar) or a better error, both might have sense
What does this mean? docs.rs intentionally does not have an opt-out mechanism: rust-lang/docs.rs#125
I first opened an issue to this crate, so I link to it so you can have more context: https://github.com/taiki-e/cargo-llvm-cov/issues/248
I personally think it's an acceptable behaviour. It'll just create an empty documentation and that's it. Seems like a weird use case indeed though.
I opened https://github.com/rust-lang/rust/pull/109726 which fixes the rustdoc crash in the meantime (which therefore generates empty documentation).
Problem
Hi, I found a possible bug (or at least, bad error message) while generating documentation for a library with
#![doc(hidden)]
. The use case is a library with private documentation published to crates.io. The docs page is generated and failing. In the docs page you see all broken but no documentation is intended.(It's a third party crate so I don't have decision on having no documentation)
The error thrown by
cargo doc
is somewhat obscure, as hiding docs is intentional:(Full paths have been trimmed)
I'd expect docs to be generated and either an empty docs page or with a simple message indicating this crate has no/hidden docs.
Steps
Create a new cargo project:
Open
src/lib.rs
and add a#![doc(hidden)]
in the beginning of the file.Generate docs using
cargo doc
.Possible Solution(s)
I'd expect something like either generating an empty docs page or with a simple message indicating docs are hidden for this crate.
Notes
No response
Version