Skip to content

Conversation

@sorairolake
Copy link
Contributor

  • Added a CHANGELOG.md entry

Summary

Replace the removed doc_auto_cfg feature with the doc_cfg feature.

Motivation

Avoid compilation errors when building documentation.

Details

doc_auto_cfg was merged into doc_cfg in rust-lang/rust#138907.

When docsrs is enabled, the old doc_auto_cfg results in the following errors on the latest nightlies:

error[E0557]: feature has been removed
  --> src/lib.rs:56:29
   |
56 | #![cfg_attr(docsrs, feature(doc_auto_cfg))]
   |                             ^^^^^^^^^^^^ feature has been removed
   |
   = note: removed in CURRENT_RUSTC_VERSION; see <https://github.com/rust-lang/rust/pull/138907> for more information
   = note: merged into `doc_cfg`
error[E0557]: feature has been removed
  --> rand_core/src/lib.rs:36:29
   |
36 | #![cfg_attr(docsrs, feature(doc_auto_cfg))]
   |                             ^^^^^^^^^^^^ feature has been removed
   |
   = note: removed in CURRENT_RUSTC_VERSION; see <https://github.com/rust-lang/rust/pull/138907> for more information
   = note: merged into `doc_cfg`

The new doc_cfg retains the automatic cfg generation that doc_auto_cfg used to provide.

Copy link
Member

@josephlr josephlr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, we had to do a similar thing in getrandom:

rust-random/getrandom@c904801

@josephlr josephlr merged commit 4cbd428 into rust-random:master Oct 1, 2025
16 checks passed
@sorairolake sorairolake deleted the replace-doc-auto-cfg branch October 1, 2025 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants