rust-lang / rust-lang/rust

Rustdoc should consider not hiding items that come from the same Cargo workspace

Open
#125,009 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

With PR https://github.com/rust-lang/rust/pull/124939, rustdoc hides in the "Aliased type" section of type alias every type that is not from the current crate.

However if we had access in rustdoc to the Cargo workspace information we could instead be more fine-grain and not hide those coming from the same workspace.

Crate A:

pub struct One<T>(T);

Crate B:

pub type OneString = One<String>;

If crate A and B are in the same workspace we should probably not hide the inner item, and therefor display:

// in Aliased Type
struct OneString(String)

// instead of
struct OneString(/* private items */)

@rustbot labels +T-rustdoc +A-rustdoc-ui +C-discussion

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 PR 124939 and the rustdoc behavior for the “Aliased type” section. Investigate how rustdoc could access Cargo workspace information and distinguish same-workspace items from other crates. Done means a type alias from a same-workspace crate displays its inner item, such as OneString(String), instead of /* private items */.

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
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.