You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #138907 - GuillaumeGomez:rfc-3631, r=fmease,camelid,Manishearth,lolbinarycat
Implement RFC 3631: add rustdoc doc_cfg features
Implementation of rust-lang/rfcs#3631.
This implementation actually resulted in a lot of simplifications:
* All `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.
* Because there is `cfg` inheritance, we can keep track of them in one place (in `propagate_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 only `cfg` 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 new `CfgInfo` type.
* I also suspect that `Cfg::simplify_with` could either be removed or at least used directly into `propagate_doc_cfg.rs` when we compute `cfg`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 in `rustc` (like `stdarch`) are using it, so we need to have a nightly released with this PR before I can switch to the new feature.
r? ghost
0 commit comments