Skip to content
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

Link to private item warning irrelevant in binary crates #89600

Closed
Ploppz opened this issue Oct 6, 2021 · 1 comment · Fixed by rust-lang/cargo#10142
Closed

Link to private item warning irrelevant in binary crates #89600

Ploppz opened this issue Oct 6, 2021 · 1 comment · Fixed by rust-lang/cargo#10142
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@Ploppz
Copy link

Ploppz commented Oct 6, 2021

I get this warning in my binary crate

warning: public documentation for `Poller` links to private item `Poller::revive_dead_jobs`
  --> src/periodic_tasks/poller.rs:48:12
   |
48 | /// Next, [Poller::revive_dead_jobs] is called, which compares jobs registered in the database with
   |            ^^^^^^^^^^^^^^^^^^^^^^^^ this item is private
   |
   = note: this link resolves only because you passed `--document-private-items`, but will break without

However, cargo doc by defaults actually documents private items (which I find perfectly reasonable, as this documentation is specifically for other developers to understand the internals).

My suggestion is that binary crates should default to #![allow(rustdoc::private_intra_doc_links)].

@Ploppz Ploppz added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 6, 2021
@jyn514
Copy link
Member

jyn514 commented Oct 7, 2021

@Ploppz rustdoc doesn't document private items for binaries by default, cargo passes it --document-private-items. I think this should be reported upstream to cargo, which can pass it -Arustdoc::private-intra-doc-links at the same time.

@GuillaumeGomez GuillaumeGomez added A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Oct 12, 2021
@jyn514 jyn514 removed the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
3 participants