about summary refs log tree commit diff
path: root/compiler/rustc_span/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-09-27 15:42:29 +0000
committerbors <bors@rust-lang.org>2025-09-27 15:42:29 +0000
commitc0ee51f07d271f7cf3227c60a2c59aa18c959192 (patch)
treefdf6595b1916322e45e2d6522b6444029b8fb017 /compiler/rustc_span/src
parentade84871f718ea20a6460d28e82290353b4bf3d2 (diff)
parent6cccea8731c5f8540d65c2458a36655a4b8793f3 (diff)
downloadrust-c0ee51f07d271f7cf3227c60a2c59aa18c959192.tar.gz
rust-c0ee51f07d271f7cf3227c60a2c59aa18c959192.zip
Auto merge of #138907 - GuillaumeGomez:rfc-3631, r=fmease,camelid,Manishearth,lolbinarycat
Implement RFC 3631: add rustdoc doc_cfg features

Implementation of https://github.com/rust-lang/rfcs/pull/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
Diffstat (limited to 'compiler/rustc_span/src')
-rw-r--r--compiler/rustc_span/src/symbol.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs
index faf32523baa..cd422da0c1c 100644
--- a/compiler/rustc_span/src/symbol.rs
+++ b/compiler/rustc_span/src/symbol.rs
@@ -545,6 +545,7 @@ symbols! {
         attributes,
         audit_that,
         augmented_assignments,
+        auto_cfg,
         auto_traits,
         autodiff,
         autodiff_forward,
@@ -628,7 +629,6 @@ symbols! {
         cfg_emscripten_wasm_eh,
         cfg_eval,
         cfg_fmt_debug,
-        cfg_hide,
         cfg_overflow_checks,
         cfg_panic,
         cfg_relocation_model,
@@ -1149,6 +1149,7 @@ symbols! {
         hashset_iter_ty,
         hexagon_target_feature,
         hidden,
+        hide,
         hint,
         homogeneous_aggregate,
         host,
@@ -1987,6 +1988,7 @@ symbols! {
         shl_assign,
         shorter_tail_lifetimes,
         should_panic,
+        show,
         shr,
         shr_assign,
         sig_dfl,