Skip to content

rustdoc: Footnotes don't work well when used on multiple doc comments that share page. #131901

Open
@aDotInTheVoid

Description

@aDotInTheVoid
pub struct Foo;

impl Foo {
    /// Link 1 [^1]
    ///
    /// [^1]: Hiya
    pub fn l1(){}

    /// Link 2 [^2]
    ///
    /// [^2]: Biya
    pub fn l2() {}
}

Image

Not only is this ugly, but both footnotes use the same link/number, despite being seperate in the source code.

I think the right thing to do here is to show all footnotes for a page in one place (at the bottom). This may have some subtle interactions with when markdown content appears on multiple pages (eg summaries, trait methods), but I've not looked into the details yet.

Origionly inspired by this output:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-uiArea: Rustdoc UI (generated HTML)C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.T-rustdoc-frontendRelevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions