Skip to content

rustdoc intra links: Module-level doc uses parent module's namespace instead of own #55364

Closed

Description

pub mod sub {
    //! See either [foo] or [bar].

    /// See [bar]
    pub fn foo() {}
    /// See [foo]
    pub fn bar() {}
}
2 |     //! See either [foo] or [bar].
  |                     ^^^ cannot be resolved, ignoring

I don't know if this is an accidental regression, or an intentional change, but this used to resolve.

I argue that module-level docs should have the same namespace as the module they are referring to, since referring to the items of the documented module is much more common than referring to items in the parent module.

Ref #43466

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameT-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