-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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.
Nightly feature `doc_auto_cfg` is merged into `doc_cfg` rust-lang/rust#138907
Nightly feature `doc_auto_cfg` is merged into `doc_cfg` rust-lang/rust#138907
In rust-lang/rust#138907, the `doc_auto_cfg` feature was subsumed by `doc_cfg`. This does overall look like we're on a path toward stabilization, which is great. One problem here though is that a bunch of crates use the `cfg` `docsrs` to enable `doc_auto_cfg`. So if we enable it, then it causes those crates to stop compiling. This is overall very annoying, and I don't know how to unfuck things. So I changed the `cfg` knob to `docsrs_regex` which, doesn't quite provide a guarantee, but gets us closer to being masters of our own destiny.
In rust-lang/rust#138907, the `doc_auto_cfg` feature was subsumed by `doc_cfg`. This does overall look like we're on a path toward stabilization, which is great. One problem here though is that a bunch of crates use the `cfg` `docsrs` to enable `doc_auto_cfg`. So if we enable it, then it causes those crates to stop compiling. This is overall very annoying, and I don't know how to unfuck things. So I changed the `cfg` knob to `docsrs_regex` which, doesn't quite provide a guarantee, but gets us closer to being masters of our own destiny.
In rust-lang/rust#138907, the `doc_auto_cfg` feature was subsumed by `doc_cfg`. This does overall look like we're on a path toward stabilization, which is great. One problem here though is that a bunch of crates use the `cfg` `docsrs` to enable `doc_auto_cfg`. So if we enable it, then it causes those crates to stop compiling. This is overall very annoying, and I don't know how to unfuck things. So I changed the `cfg` knob to `docsrs_regex` which, doesn't quite provide a guarantee, but gets us closer to being masters of our own destiny.
In rust-lang/rust#138907, the `doc_auto_cfg` feature was subsumed by `doc_cfg`. This does overall looks like we're on a path toward stabilization, which is great. One problem here though is that a bunch of crates use the `cfg` `docsrs` to enable `doc_auto_cfg`. So if we enable it, then it causes those crates to emit hard errors. This is overall very annoying, and I don't know how to unfuck things. So I changed the `cfg` knob to `docsrs_jiff` which, doesn't quite provide a guarantee, but gets us closer to being masters of our own destiny. See also a similar change made to `regex`: rust-lang/regex#1305
In rust-lang/rust#138907, the `doc_auto_cfg` feature was subsumed by `doc_cfg`. This does overall looks like we're on a path toward stabilization, which is great. One problem here though is that a bunch of crates use the `cfg` `docsrs` to enable `doc_auto_cfg`. So if we enable it, then it causes those crates to emit hard errors. This is overall very annoying, and I don't know how to unfuck things. So I changed the `cfg` knob to `docsrs_jiff` which, doesn't quite provide a guarantee, but gets us closer to being masters of our own destiny. See also a similar change made to `regex`: rust-lang/regex#1305
the feature gate name changed See rust-lang/rust#138907
The feature gate name changed See rust-lang/rust#138907
the feature gate name changed See rust-lang/rust#138907
the feature gate name changed See rust-lang/rust#138907 📬 *Issue #, if available:* ✍️ *Description of changes:* 🔏 *By submitting this pull request* - [x] I confirm that I've made a best effort attempt to update all relevant documentation. - [x] I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Co-authored-by: Ariel Ben-Yehuda <[email protected]>
Our latest release failed to build on docs.rs [1] because the `doc_auto_cfg` feature has been subsumed by `doc_cfg`: rust-lang/rust#138907 [1]: https://docs.rs/crate/uefi/0.36.0/builds/2603179
Implementation of rust-lang/rfcs#3631.
This implementation actually resulted in a lot of simplifications:
cfg
computation is now done in one place:propagate_doc_cfg.rs
. Because (trait)impl
s 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.cfg
inheritance, 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 onlycfg
attributes.propagate_doc_cfg.rs
is also now much simpler, much less need to keep track of parents, since everything we need is handled by the newCfgInfo
type.Cfg::simplify_with
could either be removed or at least used directly intopropagate_doc_cfg.rs
when we computecfg
s. 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