Skip to content

Intra-doc links choose a random method if there are multiple implementations of the same generic trait #76895

Open
@jyn514

Description

@jyn514

This is case three from #74489.

If a type implements a trait that's generic and implemented multiple times with different generic parameters, then rustdoc generates the same link for each. For example, [String::from] resolves to https://doc.rust-lang.org/nightly/alloc/string/struct.String.html#method.from.

However, every From implementation on String has a method called from! So the browser picks a random one.

This requires two fixes:

Metadata

Metadata

Assignees

Labels

A-associated-itemsArea: Associated items (types, constants & functions)A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameC-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