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 fails to link to private items without warning #72769

Closed
jyn514 opened this issue May 30, 2020 · 2 comments · Fixed by #72771
Closed

rustdoc fails to link to private items without warning #72769

jyn514 opened this issue May 30, 2020 · 2 comments · Fixed by #72771
Assignees
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

@jyn514
Copy link
Member

jyn514 commented May 30, 2020

I tried this code:

/// See also [`g()`][crate::g]
pub fn f() {}

fn g() {}

I expected to see this happen:

warning: `[crate::g]` cannot be resolved, ignoring it.

or preferably

warning: `[crate::g]` is private and therefore cannot be linked, ignoring it.

Instead, this happened: The crate documents without warnings, but does not generate links: See also [g()][crate::g]

Meta

$ rustdoc +nightly --version
rustdoc 1.45.0-nightly (4bd32c980 2020-05-29)

@rustbot modify labels: T-rustdoc A-intra-doc-links

@jyn514 jyn514 added the C-bug Category: This is a bug. label May 30, 2020
@rustbot rustbot 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 May 30, 2020
@jyn514
Copy link
Member Author

jyn514 commented May 30, 2020

I'm interested in fixing this if someone is willing to mentor, presumably I'd start somewhere in src/librustdoc/passes/collect_intra_doc_links.rs?

@jyn514
Copy link
Member Author

jyn514 commented May 30, 2020

Related to #65697, but without --document-private-items involved.

Manishearth added a commit to Manishearth/rust that referenced this issue Jun 26, 2020
@bors bors closed this as completed in 8adc781 Jun 27, 2020
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

Successfully merging a pull request may close this issue.

2 participants