Skip to content

Link to private item warning irrelevant in binary crates #89600

Closed
rust-lang/cargo
#10142

Description

@Ploppz

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)].

Activity

  1. added
    A-diagnosticsArea: Messages for errors, warnings, and lints
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Oct 6, 2021
  2. jyn514 commented on Oct 7, 2021

    @jyn514
    Member

    @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.

  3. added
    A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by name
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    on Oct 12, 2021
  4. removed
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Feb 14, 2022
  5. added a commit that references this issue on May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions