rust-lang / rust-lang/rust

rustdoc: methods on type aliases do not properly link to themselves

Open
#131,028 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-rustdoc-ui C-bug E-needs-mcve T-rustdoc
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

example: https://docs.rs/oauth2/5.0.0-alpha.1/oauth2/basic/type.BasicClient.html#method.set_token_uri

broken html:

<section id="method.set_token_uri" class="method"><a class="src rightside" href="../../src/oauth2/client.rs.html#348-376">source</a><h4 class="code-header">pub fn <a href="../../oauth2/struct.Client.html#tymethod.set_token_uri" class="fn">set_token_uri</a>(
    self,
    token_url: <a class="struct" href="../../oauth2/struct.TokenUrl.html" title="struct oauth2::TokenUrl">TokenUrl</a>
) -&gt; <a class="struct" href="../../oauth2/struct.Client.html" title="struct oauth2::Client">Client</a>&lt;TE, TR, TT, TIR, RT, TRE, HAS_AUTH_URL, HAS_DEVICE_AUTH_URL, HAS_INTROSPECTION_URL, HAS_REVOCATION_URL, true&gt;</h4></section>

note that the id is method.set_token_uri but the href uses tymethod (and also links to the page for the base type, not the page for the alias).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the generated HTML at the linked docs.rs page, focusing on the type-alias method anchor and its method link. Trace the rustdoc entry point responsible for these links; done means the method's href uses the matching method kind and points to the alias page rather than the base type page.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.