rust-lang / rust-lang/rust

rustdoc: Don't expand type aliases in inherent impls

Open
#119,036 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-rustdoc-ui C-enhancement T-rustdoc
Dominant language
Rust
Stars
119k
Forks
16.2k
PR merge metrics
PR metrics pending

Description

Currently, rustdoc expands aliases when used as the type of an inherent implementation:

pub struct Foo<T>(T);
pub type Simple = Foo<()>;
impl Simple {
    pub fn xyz() {}
}

Generates:

Screenshot 2023-12-17 at 08 07 08

I expected to see impl Simple (especially since Simple is left unexpanded in function signatures).

@rustbot label +A-rustdoc-ui +C-enhancement

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 reproducing the issue's Rust example with rustdoc and compare the generated output with the expected impl Simple rendering. Trace the rustdoc handling of inherent implementations and type aliases; done means the alias remains unexpanded in the impl output while existing function-signature behavior is preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.