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

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

Closed
ppentchev opened this issue May 23, 2022 · 1 comment
Closed
Labels
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

@ppentchev
Copy link

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!

@ppentchev ppentchev 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 May 23, 2022
@GuillaumeGomez GuillaumeGomez added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name and removed 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 May 23, 2022
@jyn514
Copy link
Member

jyn514 commented May 25, 2022

Duplicate of #83049

@jyn514 jyn514 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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
Development

No branches or pull requests

3 participants