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 cannot resolve private intra-rustdoc link #65697

Closed
dragostis opened this issue Oct 22, 2019 · 2 comments
Closed

rustdoc cannot resolve private intra-rustdoc link #65697

dragostis opened this issue Oct 22, 2019 · 2 comments
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@dragostis
Copy link

When in a private mod, rustdoc fails to resolve a private member when called with --document-private-items.

A project like this...
src/lib.rs:

mod foo;

src/foo.rs:

//! [`Bar`]
struct Bar;

... results in:

warning: `[Bar]` cannot be resolved, ignoring it...
 --> src/foo.rs:1:6
  |
1 | //! [`Bar`]
  |      ^^^^^ cannot be resolved, ignoring
  |
  = note: `#[warn(intra_doc_link_resolution_failure)]` on by default
  = help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

@jonas-schievink jonas-schievink added A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Oct 22, 2019
@jyn514
Copy link
Member

jyn514 commented May 31, 2020

The culprit is here:

if !did.is_local() && !cache.access_levels.is_public(did) {

We should check there if --document-private-items was passed, and if so, don't skip the item.

@jyn514
Copy link
Member

jyn514 commented Jun 27, 2020

Fixed in #72771

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 C-bug Category: This is a bug. 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

4 participants