-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Split doc_cfg and doc_auto_cfg features #90502
Conversation
This comment has been minimized.
This comment has been minimized.
c6a5c6c
to
7fec79a
Compare
This comment has been minimized.
This comment has been minimized.
75dddfe
to
7052668
Compare
Ok, let's see if |
7052668
to
d50a475
Compare
This comment has been minimized.
This comment has been minimized.
@GuillaumeGomez do you mind updating tidy to also look in |
Ah so that's what I thought. Adding a check in tidy then. |
Ah perfect, seems like CI passed this time! \o/ |
@bors r+ |
📌 Commit d7afbf6 has been approved by |
This PR is beta-nominated. Does it make more sense to just disable |
…askrgr Rollup of 6 pull requests Successful merges: - rust-lang#90084 (Make printed message match the code comment) - rust-lang#90354 (Document clippy on nightly-rustc) - rust-lang#90417 (stabilize `relaxed_struct_unsize`) - rust-lang#90472 (Clarify what to do with accepted feature gates) - rust-lang#90500 (Update Clippy dependencies) - rust-lang#90502 (Split doc_cfg and doc_auto_cfg features) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
@@ -688,6 +688,9 @@ declare_features! ( | |||
/// not changed from prior instances of the same struct (RFC #2528) | |||
(incomplete, type_changing_struct_update, "1.58.0", Some(86555), None), | |||
|
|||
/// Tells rustdoc to automatically generate `#[doc(cfg(...))]`. | |||
(active, doc_auto_cfg, "1.58.0", Some(43781), None), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this was beta-accepted
, I took the liberty of adjusting it to "1.57.0" in #90938. Would someone care to fix that on master as well?
[beta] backports - Fix assertion failures in OwnedHandle with windows_subsystem. rust-lang#88798 - Ensure that pushing empty path works as before on verbatim paths rust-lang#89665 - Feature gate + make must_not_suspend allow-by-default rust-lang#89826 - Only use clone3 when needed for pidfd rust-lang#89930 - Fix documentation header sizes rust-lang#90186 - Fixes incorrect handling of ADT's drop requirements rust-lang#90218 - Fix ICE when forgetting to Box a parameter to a Self::func call rust-lang#90221 - Prevent duplicate caller bounds candidates by exposing default substs in Unevaluated rust-lang#90266 - Update odht crate to 0.3.1 (big-endian bugfix) rust-lang#90403 - rustdoc: Go back to loading all external crates unconditionally rust-lang#90489 - Split doc_cfg and doc_auto_cfg features rust-lang#90502 - Apply adjustments for field expression even if inaccessible rust-lang#90508 - Warn for variables that are no longer captured rust-lang#90597 - Properly register text_direction_codepoint_in_comment lint. rust-lang#90626 - CI: Use ubuntu image to download openssl, curl sources, cacert.pem for x86 dist builds rust-lang#90457 - Android is not GNU rust-lang#90834 - Update llvm submodule rust-lang#90954 Additionally, this bumps the stage 0 compiler from beta to stable 1.56.1. r? `@Mark-Simulacrum`
Lots of things in the library are only compiled when certain features are enabled. However, it is not always clear to the user that in order to use an item, it will need features x, y, and z, because by default, this information is not shown. Fortunately, a feature in `rustdoc` is being developed to provide such information in the documentation, `doc_cfg`, which is usable right now in Nightly Rust. To use it, you simply had to activate the feature somewhere (preferably the crate root) using `#![feature(doc_cfg)]` and then add `#[doc(cfg(feature = "x"))]` on an item to display that said item requires the `x` feature. What is awesome about this is that it can be automatically derived for all `#[cfg(...)]` instances for you. Unfortunately, it was found out that the auto mode isn't appropriate in all cases and may sometimes pick the wrong `#[cfg(...)]`. For this reason, in the "Split doc_cfg and doc_auto_cfg features" pull request[0], the auto mode has been split into a separate feature. This commit changes the feature activation line in `lib.rs` to use `doc_auto_cfg` instead of `doc_cfg`. [0]: rust-lang/rust#90502
This makes it so one doesn't need to manually configure the documentation cfg for feature flags. rust-lang/rust#90502 Fixes pola-rs#6123
Part of #90497.
With this feature,
doc_cfg
won't pick up items automatically anymore.cc @Mark-Simulacrum
r? @jyn514