Skip to content

Rustdoc: always render required features, even if they are default #115840

@jaskij

Description

@jaskij

As best I can tell, currently Rustdoc only renders the "Availabe on crate feature xxx only." box if this feature is not default.

For various reasons, a library user may want to cut down and use default-features = false in their Cargo.toml (in fact, IMO it's good practice for libraries). In those cases, if something is gated behind one of the default features, it leads to confusion, and makes it hard to discover which features are required for a part of a crate to be present.

What I would like to see, is for the required feature box to be always present, even if something is gated behind a default feature.

Activity

added
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Sep 14, 2023
added
T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
on Sep 14, 2023
added
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.
and removed
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.F-doc_auto_cfg`#![feature(doc_auto_cfg)]`F-doc_cfg`#![feature(doc_cfg)]`T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jaskij@notriddle@saethlin@fmease@rustbot

        Issue actions

          Rustdoc: always render required features, even if they are default · Issue #115840 · rust-lang/rust