Skip to content

rustdoc: Incorrect link to item when the item is reexported and inlined #83976

Open
@SamRodri

Description

@SamRodri

Building the documentation of this code using cargo doc generates a link to the wrong page:

pub mod some {
    pub mod path {
        pub struct Foo;
    }

    #[doc(inline)]
    pub use path::Foo as Bar;
}

/// Link to [`Foo`](crate::some::path::Foo).
pub struct Test;

I expected a link to the some/path/struct.Foo.html page, but got a link to the some/struct.Bar.html page.

Meta

The error happens in the stable 1.51.0 and nightly 2021-04-07 versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.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