Skip to content

Conversation

@camelid
Copy link
Member

@camelid camelid commented Jan 2, 2026

Previously, these failed to resolve, despite them working for struct
fields or enum variants that were behind aliases.

However, there is now an inconsistency where enum variant fields behind
an alias resolve to the entry on the alias's page, while enum variants
and struct fields resolve to the page of the backing ADT.
The old name and API were confusing. In my opinion, looking up the type
at the call site is clearer.
All the other parts of this function return the Res for the containing
page, but for some reason, this returns the associated item itself. It
doesn't seem to affect the behavior of rustdoc because e.g. the href
functions use the parent if the DefId is for an assoc item. But it's
clearer and simpler to be consistent.
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Jan 2, 2026
@GuillaumeGomez
Copy link
Member

Is it ready for review? (It's a draft so wondering ^^')

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

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants