Skip to content

After doc_auto_cfg is gone, in the generated docs, nested structs do not receive the feature label anymore #150268

@rodrigocfd

Description

@rodrigocfd

Context

This issue came after this discussion in the Rust Users forum:

Problem

After doc_auto_cfg being merged with doc_cfg, entities in nested modules do not receive the label anymore. I attached a zip with a minimal reproducible example:

broken-feats.zip

In the generated docs, both structs should have the feature label, but the nested one doesn't:

Image

The command to generate the docs is:

RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features

Version

rustdoc 1.92.0 (ded5c06cf 2025-12-08)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions