rust-lang / rust-lang/rust

rustdoc: Feature-dependent trait impls don't have the feature dependency called out.

Open
#145,732 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Example: https://docs.rs/aead/0.5.2/aead/struct.Error.html . Reading those docs suggests that the aead::Error type implements std::error::Error unconditionally. However if you look at the source code, the impl is gated by the std feature, which in this crate is disabled by default.

This is a little confusing, because in general docs.rs is very good about flagging feature-dependent crate components. For example, also in the aead crate, the Aead trait is prominently flagged as requiring the alloc feature.

It would be nice to flag feature-dependent trait implementations in the same fashion.

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 examining rustdoc's handling of feature-gated items and compare the aead::Error and Aead examples linked in the issue. Trace how trait implementations are rendered, then verify that an implementation gated by a crate feature is visibly marked as requiring that feature in generated documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation, tooling
Issue type
Feature
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.