rust-lang / rust-lang/rust

rustdoc: indicate when a trait has non-defaulted hidden items

Open
#138,697 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

There’s a pattern of hiding a non-defaulted item in a trait to mark it as non-implementable, e.g. inventory::Collect:

https://github.com/dtolnay/inventory/blob/5e915d4d197432b73375ad21e08a1ee8275d8309/src/lib.rs#L224-L227

This is primarily useful when a trait is implemented by a macro, so it can’t be properly sealed, but still needs to be only implementable by code “originating” in the same crate. It has some similarity with #[non_exhaustive] attribute.

Some options on how this could look:

Image

Image

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 rustdoc's handling of trait items and inspect the inventory/src/lib.rs example at lines 224-227. Compare the two proposed renderings in the issue and establish the intended presentation for traits with hidden non-defaulted items. Done means rustdoc clearly indicates this condition in the generated documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.