Skip to content

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

Closed
@jyn514

Description

@jyn514

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameA-visibilityArea: Visibility / privacyC-bugCategory: This is a bug.T-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