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
{{ message }}
Repository navigation
doc(hidden) stopped working in binary crates #67851
If I have the following binary crate, cargo doc on stable 1.40.0 will correctly show g and not f, while beta will show both despite f being doc(hidden).
#[doc(hidden)]pubfnf(){}pubfng(){}fnmain(){}
I understand that we want private things documented for bin crates, but I am labeling this a regression because this makes it impossible for macro-generated code to hide distracting implementation details that might overwhelm the actual useful API of the generated code.
I would like to suggest continuing to leave doc(hidden) items out of bin crate documentation as the default behavior of cargo doc.
Just for reference, the PR you linked (rust-lang/cargo#7593) is not directly responsible for the buggy behavior. You can see the problem with 1.40 by cargo doc --document-private-items (which also documents f).
Could it be that we simply have to add a STRIP_HIDDEN pass here (and potentially some other arrays in that file)?
Activity
Eh2406 commentedon Jan 4, 2020
Your suggestion seems entirely reasonable to me. I don't know what PR wuld need to go where to impl it.
dtolnay commentedon Jan 4, 2020
@rust-lang/cargo @rust-lang/rustdoc, any tips for what PRs would need to go where?
LukasKalbertodt commentedon Jan 4, 2020
Just for reference, the PR you linked (rust-lang/cargo#7593) is not directly responsible for the buggy behavior. You can see the problem with 1.40 by
cargo doc --document-private-items(which also documentsf).Could it be that we simply have to add a
STRIP_HIDDENpass here (and potentially some other arrays in that file)?rust/src/librustdoc/passes/mod.rs
Lines 89 to 98 in e845e69
Rollup merge of rust-lang#67875 - dtolnay:hidden, r=GuillaumeGomez
Rollup merge of rust-lang#67875 - dtolnay:hidden, r=GuillaumeGomez
Rollup merge of rust-lang#67875 - dtolnay:hidden, r=GuillaumeGomez
jtmoon79 commentedon Jan 10, 2025
Relates to #66528