rust-lang / rust-lang/rust

rustdoc: hide inherent impls with private impl items

Open
#137,596 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

cc #137576. Rustdoc currently shows inherent impl items even if all impl items are private. This affects BTreeMap:

https://github.com/rust-lang/rust/blob/ad27045c31a9f37ad7d44ca2a403de52d1a896d3/library/alloc/src/collections/btree/map.rs#L292-L315

Image of https://doc.rust-lang.org/nightly/std/collections/struct.BTreeMap.html#impl-BTreeMap%3CK,+SetValZST,+A%3E

I feel like the proper fix for this issue is for rustdoc to not show internal inherent impls even if the impl has a doc comment.

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 with library/alloc/src/collections/btree/map.rs at lines 292-315 and inspect how rustdoc presents the linked BTreeMap inherent impl. Confirm the behavior for impls whose items are all private, including when the impl has a documentation comment; the issue does not name a test file.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.