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)
After rust-lang/rust#138907 merged
doc_auto_cfgintodoc_cfg, rustdoc's auto-cfg detection no longer propagates#[cfg(...)]attributes onimplblocks 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-gatedimplblock insrc/io/cursor.rsandsrc/io/impls.rs. There is a pointer comment insrc/lib.rsnext to thefeature(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)