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 does not warn when linking to a private associated item #81981

Closed
jyn514 opened this issue Feb 11, 2021 · 0 comments · Fixed by #82011
Closed

Rustdoc does not warn when linking to a private associated item #81981

jyn514 opened this issue Feb 11, 2021 · 0 comments · Fixed by #82011
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name A-visibility Area: Visibility / privacy 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 Feb 11, 2021

I tried this code:

//! Link to [S::f]

pub use inner::S;

mod inner {
    pub struct S;
    impl S {
        fn f() {}
    }
}

I expected to see this happen: Rustdoc warns that S::f is private, the same way it would warn if S were private.

Instead, this happened: Rustdoc gives no warning and generates no link.

Meta

rustdoc --version: rustdoc 1.52.0-nightly (9778068 2021-02-07)

@jyn514 jyn514 added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-diagnostics Area: Messages for errors, warnings, and lints A-visibility Area: Visibility / privacy C-bug Category: This is a bug. A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name labels Feb 11, 2021
JohnTitor added a commit to JohnTitor/rust that referenced this issue Feb 12, 2021
…ax-heller

Fix private intra-doc warnings on associated items

The issue was that the `kind, id` override was previously only being
considered for the disambiguator check, not the privacy check. This uses
the same ID for both.

Fixes rust-lang#81981.

r? `@max-heller`
@bors bors closed this as completed in 6830ea1 Feb 12, 2021
nars1 pushed a commit to YottaDB/YDBRust that referenced this issue Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name A-visibility Area: Visibility / privacy 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.

1 participant