Skip to content

rustdoc: link from a private item to a private item in a different module #97310

Closed as not planned
@ppentchev

Description

@ppentchev

Hi,

First of all, thanks a lot for working on Rust and the related projects!

If I'm reading https://rust-lang.github.io/rfcs/1946-intra-rustdoc-links.html#links-to-private-items correctly, then the documentation of a private item should be able to link to the documentation of another private item. This works if both items are in the same module, but for the (somewhat convoluted) code that I've put up in a GitLab repository it seems to fail: rustdoc cannot generate a link to the process::State structure when documenting the defs::do_clean() function.

The current output is:

 Documenting bug-doc-link-private v0.1.0 (/home/roam/lang/rust/misc/bug-doc-link-private)
warning: unresolved link to `self::process::State`
  --> src/defs.rs:40:11
   |
40 | /// the [`crate::process::State`] structure's `value` field to never be incremented.
   |           ^^^^^^^^^^^^^^^^^^^^^ no item named `State` in module `process`
   |
   = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default

FWIW, this happens with Rust 1.61.0:

rustc 1.61.0 (fe5b13d68 2022-05-18)
binary: rustc
commit-hash: fe5b13d681f25ee6474be29d748c65adcd91f69e
commit-date: 2022-05-18
host: x86_64-unknown-linux-gnu
release: 1.61.0
LLVM version: 14.0.0

Thanks again, and keep up the great work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-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