Skip to content

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

Open
@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.

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

    Issue actions