Skip to content

Remove per-impl-block doc(cfg) workaround once rust-lang/rust#150268 is fixed #6

@daira

Description

@daira

After rust-lang/rust#138907 merged doc_auto_cfg into doc_cfg, rustdoc's auto-cfg detection no longer propagates #[cfg(...)] attributes on impl blocks to the rendered impl view. Method-level cfgs are still detected automatically.

Tracked upstream as rust-lang/rust#150268 .

In the docs.rs configuration PR for #5, this was worked around by adding explicit #[cfg_attr(docsrs, doc(cfg(feature = "alloc")))] annotations to every alloc-gated impl block in src/io/cursor.rs and src/io/impls.rs. There is a pointer comment in src/lib.rs next to the feature(doc_cfg) / doc(auto_cfg) attributes.

Once the upstream regression is fixed in a rustdoc version that docs.rs uses, drop the per-impl-block #[cfg_attr(docsrs, doc(cfg(...)))] annotations and the pointer comment, and confirm that the published docs still render the "Available on crate feature `alloc` only" badges on the affected impls.

🤖 Claude Opus 4.7 (1M context)

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationfiled using AIIssue or PR filed with the assistance of an AI coding assistant

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions