Skip to content

rustdoc generates duplicate id attributes #25001

Closed
@apasel422

Description

@apasel422

When two items in the same documentation page have the same name, rustdoc generates duplicate HTML id attributes for them. This makes the HTML invalid, but more importantly, it makes it impossible to link to anything but the one that shows up first in the source.

For example, Vec's page contains multiple impls of IntoIterator, and therefore multiple HTML elements that have an id attribute of assoc_type.Item, assoc_type.IntoIter, and method.into_iter.

This is not limited to impls of the same trait, as different traits (and inherent impls) could define methods or associated types with the same name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    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