rust-lang / rust-lang/rust

rustdoc::formats::Cache does not contain enough data to unwrap type aliases

Open
#138,617 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-discussion T-rustdoc
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

rustdoc has a lot of issues handling type aliases, and I think a large part of that is due to the fact that once the cleaned ast is constructed, type aliases are essentially opaque, and code cannot see what type they point to.

clean::TypeAlias does exist, but there's no way to get that from a Path item, which is what shows up in type args.

I encountered this when working on https://github.com/rust-lang/rust/pull/138574

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 reading rustdoc::formats::Cache, clean::TypeAlias, and the Path handling mentioned in the issue, then inspect pull request 138574 for the triggering case. Establish which type-alias information is missing and identify rustdoc cases that demonstrate the failure; the issue is complete only when those aliases can be unwrapped reliably.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.