Implement RFC 3631: add rustdoc doc_cfg features#138907
Merged
bors merged 22 commits intorust-lang:masterfrom Sep 27, 2025
Merged
Implement RFC 3631: add rustdoc doc_cfg features#138907bors merged 22 commits intorust-lang:masterfrom
bors merged 22 commits intorust-lang:masterfrom
Conversation
This comment has been minimized.
This comment has been minimized.
Contributor
Member
Author
|
Noted! And that will be a nice improvement, thanks! Just one thing left for the cfg expansion missing: |
Contributor
Do you mean like in #138515? :) |
Member
Author
|
You're my hero! Gonna need to handle this new attribute then. :) |
4a05a52 to
3d2eef1
Compare
This comment has been minimized.
This comment has been minimized.
Collaborator
|
☔ The latest upstream changes (presumably #138923) made this pull request unmergeable. Please resolve the merge conflicts. |
d88598f to
db25eea
Compare
This comment has been minimized.
This comment has been minimized.
Collaborator
|
☔ The latest upstream changes (presumably #138927) made this pull request unmergeable. Please resolve the merge conflicts. |
b8cb424 to
b581ce1
Compare
This comment has been minimized.
This comment has been minimized.
b581ce1 to
1cb7fac
Compare
This comment has been minimized.
This comment has been minimized.
71369a1 to
fbee8a9
Compare
This comment has been minimized.
This comment has been minimized.
handewo
pushed a commit
to handewo/ratatui
that referenced
this pull request
Dec 29, 2025
The doc_auto_cfg feature was incorporated into the doc_cfg feature in rust-lang/rust#138907 Closes ratatui#2102 Signed-off-by: Shingo OKAWA <shingo.okawa.g.h.c@gmail.com>
Kobzol
pushed a commit
to Kobzol/rustc_codegen_cranelift
that referenced
this pull request
Dec 29, 2025
Fix removed version numbers of `doc_auto_cfg` and `doc_cfg_hide` Tracking issue: rust-lang/rust#43781 The `doc_auto_cfg` and `doc_cfg_hide` features were removed in a recent nightly (by rust-lang/rust#138907). I believe that the rustc version numbers at which the features were declared to be removed were incorrect, however, and should both be "1.92" (±1). As evidence in favour of this, the error we get from using this was: ```text error[E0557]: feature has been removed --> src/lib.rs:22:29 | 22 | #![cfg_attr(docsrs, feature(doc_auto_cfg))] | ^^^^^^^^^^^^ feature has been removed | = note: removed in 1.58.0; see <rust-lang/rust#138907> for more information = note: merged into `doc_cfg` ``` Note especially the "removed in 1.58" claim. Further evidence is found in the comment further up this file: https://github.com/rust-lang/rust/blob/4ffeda10e10d4fa0c8edbd0dd9642d8ae7d3e66e/compiler/rustc_feature/src/removed.rs#L49-L53 I've chosen 1.92 as that was the milestone which rust-lang/rust#138907 was added to. cc `@GuillaumeGomez`
mirsella
added a commit
to mirsella/renet2
that referenced
this pull request
Jan 3, 2026
UkoeHB
pushed a commit
to UkoeHB/renet2
that referenced
this pull request
Jan 3, 2026
MatteoH2O1999
added a commit
to MatteoH2O1999/par-slice-rs
that referenced
this pull request
Jan 4, 2026
crepererum
added a commit
to crepererum/arrow-rs-object-store
that referenced
this pull request
Jan 5, 2026
See https://docs.rs/crate/object_store/latest/builds/2752265 : ```text [INFO] [stderr] Documenting object_store v0.13.0 (/opt/rustwide/workdir) [INFO] [stderr] error[E0557]: feature has been removed [INFO] [stderr] --> src/lib.rs:18:29 [INFO] [stderr] | [INFO] [stderr] 18 | #![cfg_attr(docsrs, feature(doc_auto_cfg))] [INFO] [stderr] | ^^^^^^^^^^^^ feature has been removed [INFO] [stderr] | [INFO] [stderr] = note: removed in 1.92.0; see <rust-lang/rust#138907> for more information [INFO] [stderr] = note: merged into `doc_cfg` [INFO] [stderr] [INFO] [stderr] error: Compilation failed, aborting rustdoc [INFO] [stderr] [INFO] [stderr] For more information about this error, try `rustc --explain E0557`. [INFO] [stderr] error: could not document `object_store` ```
crepererum
added a commit
to apache/arrow-rs-object-store
that referenced
this pull request
Jan 5, 2026
See https://docs.rs/crate/object_store/latest/builds/2752265 : ```text [INFO] [stderr] Documenting object_store v0.13.0 (/opt/rustwide/workdir) [INFO] [stderr] error[E0557]: feature has been removed [INFO] [stderr] --> src/lib.rs:18:29 [INFO] [stderr] | [INFO] [stderr] 18 | #![cfg_attr(docsrs, feature(doc_auto_cfg))] [INFO] [stderr] | ^^^^^^^^^^^^ feature has been removed [INFO] [stderr] | [INFO] [stderr] = note: removed in 1.92.0; see <rust-lang/rust#138907> for more information [INFO] [stderr] = note: merged into `doc_cfg` [INFO] [stderr] [INFO] [stderr] error: Compilation failed, aborting rustdoc [INFO] [stderr] [INFO] [stderr] For more information about this error, try `rustc --explain E0557`. [INFO] [stderr] error: could not document `object_store` ``` Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
roeap
pushed a commit
to roeap/delta-kernel-rs
that referenced
this pull request
Jan 8, 2026
## What changes are proposed in this pull request? Noticed docs didn't build successfully for [0.17.0 release](https://docs.rs/crate/delta_kernel/0.17.0/builds/2652981) since in rustc 1.92 the `doc_auto_cfg` feature was removed (and TIL docs.rs builds with nightly). This pr just moves from the `doc_auto_cfg` to `doc_cfg` (see associated [rust pr](rust-lang/rust#138907)). ## How was this change tested? docs only. reproed with `cargo +nightly doc`
alamb
added a commit
to alamb/arrow-rs-object-store
that referenced
this pull request
Jan 8, 2026
See https://docs.rs/crate/object_store/latest/builds/2752265 : ```text [INFO] [stderr] Documenting object_store v0.13.0 (/opt/rustwide/workdir) [INFO] [stderr] error[E0557]: feature has been removed [INFO] [stderr] --> src/lib.rs:18:29 [INFO] [stderr] | [INFO] [stderr] 18 | #![cfg_attr(docsrs, feature(doc_auto_cfg))] [INFO] [stderr] | ^^^^^^^^^^^^ feature has been removed [INFO] [stderr] | [INFO] [stderr] = note: removed in 1.92.0; see <rust-lang/rust#138907> for more information [INFO] [stderr] = note: merged into `doc_cfg` [INFO] [stderr] [INFO] [stderr] error: Compilation failed, aborting rustdoc [INFO] [stderr] [INFO] [stderr] For more information about this error, try `rustc --explain E0557`. [INFO] [stderr] error: could not document `object_store` ``` Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
alamb
added a commit
to apache/arrow-rs-object-store
that referenced
this pull request
Jan 9, 2026
See https://docs.rs/crate/object_store/latest/builds/2752265 : ```text [INFO] [stderr] Documenting object_store v0.13.0 (/opt/rustwide/workdir) [INFO] [stderr] error[E0557]: feature has been removed [INFO] [stderr] --> src/lib.rs:18:29 [INFO] [stderr] | [INFO] [stderr] 18 | #![cfg_attr(docsrs, feature(doc_auto_cfg))] [INFO] [stderr] | ^^^^^^^^^^^^ feature has been removed [INFO] [stderr] | [INFO] [stderr] = note: removed in 1.92.0; see <rust-lang/rust#138907> for more information [INFO] [stderr] = note: merged into `doc_cfg` [INFO] [stderr] [INFO] [stderr] error: Compilation failed, aborting rustdoc [INFO] [stderr] [INFO] [stderr] For more information about this error, try `rustc --explain E0557`. [INFO] [stderr] error: could not document `object_store` ``` Co-authored-by: Marco Neumann <marco@crepererum.net>
roypat
pushed a commit
to rust-vmm/linux-loader
that referenced
this pull request
Jan 12, 2026
The current documentation build in docs.rs breaks with the following
error:
[INFO] [stderr] error[E0557]: feature has been removed
[INFO] [stderr] --> src/lib.rs:11:29
[INFO] [stderr] |
[INFO] [stderr] 11 | #![cfg_attr(docsrs, feature(doc_auto_cfg))]
[INFO] [stderr] | ^^^^^^^^^^^^ feature has been removed
[INFO] [stderr] |
[INFO] [stderr] = note: removed in 1.92.0; see <rust-lang/rust#138907> for more information
[INFO] [stderr] = note: merged into `doc_cfg`
So replace `doc_auto_cfg` with `doc_cfg`, which generates the expected
docs, showing the required features for each module.
Signed-off-by: Carlos López <carlos.lopezr4096@gmail.com>
joshuachp
added a commit
to joshuachp/rustls-native-certs
that referenced
this pull request
Jan 14, 2026
The nightly feature has been removed in rust 1.92, see docs.rs build failure https://docs.rs/crate/rustls-native-certs/latest/builds/2773223 and rust PR rust-lang/rust#138907.
joshuachp
added a commit
to joshuachp/rustls-native-certs
that referenced
this pull request
Jan 14, 2026
The nightly feature has been removed in rust 1.92, see docs.rs build failure https://docs.rs/crate/rustls-native-certs/latest/builds/2773223 and rust PR rust-lang/rust#138907. Also, renamed the cfg into `rustls_native_certs_docsrs`. See rustls/rustls#2682 for more info.
yukiiiteru
added a commit
to yukiiiteru/volo
that referenced
this pull request
Jan 19, 2026
`doc_auto_cfg` has been removed in 1.92.0, ref: <rust-lang/rust#138907> Signed-off-by: Yu Li <liyu.yukiteru@bytedance.com>
yukiiiteru
added a commit
to cloudwego/volo
that referenced
this pull request
Jan 19, 2026
* chore: remove doc_auto_cfg in volo, volo-http and volo-grpc `doc_auto_cfg` has been removed in 1.92.0, ref: <rust-lang/rust#138907> * chore: add cfg `docsrs` in test commands of rustdoc * chore: bump versions of volo, volo-http, volo-grpc --------- Signed-off-by: Yu Li <liyu.yukiteru@bytedance.com>
Chaoses-Ib
added a commit
to Chaoses-Ib/ib-matcher
that referenced
this pull request
Jan 20, 2026
cljoly
added a commit
to cljoly/rusqlite_migration
that referenced
this pull request
Jan 25, 2026
With the latest release, the build failed with the following message: ``` [INFO] [stderr] warning: target filter specified, but no targets matched; this is a no-op [INFO] [stderr] Documenting rusqlite_migration v2.4.0 (/opt/rustwide/workdir) [INFO] [stderr] error[E0557]: feature has been removed [INFO] [stderr] --> src/lib.rs:16:29 [INFO] [stderr] | [INFO] [stderr] 16 | #![cfg_attr(docsrs, feature(doc_auto_cfg))] [INFO] [stderr] | ^^^^^^^^^^^^ feature has been removed [INFO] [stderr] | [INFO] [stderr] = note: removed in 1.92.0; see <rust-lang/rust#138907> for more information [INFO] [stderr] = note: merged into `doc_cfg` [INFO] [stderr] [INFO] [stderr] error: Compilation failed, aborting rustdoc [INFO] [stderr] [INFO] [stderr] For more information about this error, try `rustc --explain E0557`. [INFO] [stderr] error: could not document `rusqlite_migration` [INFO] running `Command { std: "docker" "inspect" "26826757a8ad458b8bbb5f243bced1ac8ce41d69fd58dad40c4fdc43f3305cbf", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "26826757a8ad458b8bbb5f243bced1ac8ce41d69fd58dad40c4fdc43f3305cbf", kill_on_drop: false }` [INFO] [stdout] 26826757a8ad458b8bbb5f243bced1ac8ce41d69fd58dad40c4fdc43f3305cbf ``` (from https://docs.rs/crate/rusqlite_migration/latest/builds/2835983)
cljoly
added a commit
to cljoly/rusqlite_migration
that referenced
this pull request
Jan 25, 2026
With the latest release, the build failed with the following message: ``` [INFO] [stderr] warning: target filter specified, but no targets matched; this is a no-op [INFO] [stderr] Documenting rusqlite_migration v2.4.0 (/opt/rustwide/workdir) [INFO] [stderr] error[E0557]: feature has been removed [INFO] [stderr] --> src/lib.rs:16:29 [INFO] [stderr] | [INFO] [stderr] 16 | #![cfg_attr(docsrs, feature(doc_auto_cfg))] [INFO] [stderr] | ^^^^^^^^^^^^ feature has been removed [INFO] [stderr] | [INFO] [stderr] = note: removed in 1.92.0; see <rust-lang/rust#138907> for more information [INFO] [stderr] = note: merged into `doc_cfg` [INFO] [stderr] [INFO] [stderr] error: Compilation failed, aborting rustdoc [INFO] [stderr] [INFO] [stderr] For more information about this error, try `rustc --explain E0557`. [INFO] [stderr] error: could not document `rusqlite_migration` [INFO] running `Command { std: "docker" "inspect" "26826757a8ad458b8bbb5f243bced1ac8ce41d69fd58dad40c4fdc43f3305cbf", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "26826757a8ad458b8bbb5f243bced1ac8ce41d69fd58dad40c4fdc43f3305cbf", kill_on_drop: false }` [INFO] [stdout] 26826757a8ad458b8bbb5f243bced1ac8ce41d69fd58dad40c4fdc43f3305cbf ``` (from https://docs.rs/crate/rusqlite_migration/latest/builds/2835983)
takumi-earth
pushed a commit
to earthlings-dev/ratatui
that referenced
this pull request
Jan 27, 2026
The doc_auto_cfg feature was incorporated into the doc_cfg feature in rust-lang/rust#138907 Closes ratatui#2102 Signed-off-by: Shingo OKAWA <shingo.okawa.g.h.c@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implementation of rust-lang/rfcs#3631.
This implementation actually resulted in a lot of simplifications:
cfgcomputation is now done in one place:propagate_doc_cfg.rs. Because (trait)impls are not retrieved at the same time as the other items, we cannot perform this computation in the clean process, it needs to be after.cfginheritance, we can keep track of them in one place (inpropagate_doc_cfg.rs), meaning we don't need to copy an item's attributes to its children anymore. Only exception: impl items. For them we clone onlycfgattributes.propagate_doc_cfg.rsis also now much simpler, much less need to keep track of parents, since everything we need is handled by the newCfgInfotype.Cfg::simplify_withcould either be removed or at least used directly intopropagate_doc_cfg.rswhen we computecfgs. Considering how big the PR already is, I'll do it in a follow-up.I didn't remove the
doc_cfg*features in this PR because some dependencies used inrustc(likestdarch) are using it, so we need to have a nightly released with this PR before I can switch to the new feature.r? ghost