-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Implement RFC 3631: add rustdoc doc_cfg features #138907
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment has been minimized.
This comment has been minimized.
|
Noted! And that will be a nice improvement, thanks! Just one thing left for the cfg expansion missing: |
Do you mean like in #138515? :) |
|
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.
|
☔ 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.
|
☔ 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.
The `doc_auto_cfg` feature was removed in Rust 1.92.0 and merged into `doc_cfg` (see rust-lang/rust#138907). This fixes the docs.rs build failure for clawspec-core. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The `doc_auto_cfg` feature was removed in Rust 1.92.0 and merged into `doc_cfg` (see rust-lang/rust#138907). This fixes the docs.rs build failure for clawspec-core. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
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`
error[E0557]: feature has been removed --> src/lib.rs:42:29 | 42 | #![cfg_attr(docsrs, feature(doc_auto_cfg))] | ^^^^^^^^^^^^ feature has been removed | = note: removed in 1.92.0; see <rust-lang/rust#138907> for more information = note: merged into `doc_cfg` error: Compilation failed, aborting rustdoc
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>
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>
`doc_auto_cfg` has been removed from the current Rust version, which caused rustdoc breakages. See rust-lang/rust#138907
`doc_auto_cfg` has been removed from the current Rust version, which caused rustdoc breakages. See rust-lang/rust#138907
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>
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`
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` ```
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>
## 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`
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>
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>
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>
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.
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.
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