Skip to content

Commit eaafc5e

Browse files
Stabilize doc_cfg feature
1 parent 52fda2e commit eaafc5e

File tree

57 files changed

+46
-157
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+46
-157
lines changed

compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
181181

182182
gate_doc!(
183183
"experimental" {
184-
cfg => doc_cfg
185-
auto_cfg => doc_cfg
186184
masked => doc_masked
187185
notable_trait => doc_notable_trait
188186
}

compiler/rustc_error_codes/src/error_codes/E0536.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ The `not` cfg-predicate was malformed.
55
Erroneous code example (using `cargo doc`):
66

77
```ignore, E0536 (only triggers on cargo doc)
8-
#![feature(doc_cfg)]
98
#[doc(cfg(not()))]
109
pub fn main() {
1110
@@ -15,7 +14,6 @@ pub fn main() {
1514
The `not` predicate expects one cfg-pattern. Example:
1615

1716
```
18-
#![feature(doc_cfg)]
1917
#[doc(cfg(not(target_os = "linux")))] // ok!
2018
pub fn main() {
2119

compiler/rustc_feature/src/accepted.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ declare_features! (
187187
(accepted, do_not_recommend, "1.85.0", Some(51992)),
188188
/// Allows `#[doc(alias = "...")]`.
189189
(accepted, doc_alias, "1.48.0", Some(50146)),
190+
/// Allows `#[doc(cfg(...))]`.
191+
(accepted, doc_cfg, "1.21.0", Some(43781)),
190192
/// Allows `..` in tuple (struct) patterns.
191193
(accepted, dotdot_in_tuple_patterns, "1.14.0", Some(33627)),
192194
/// Allows `..=` in patterns (RFC 1192).

compiler/rustc_feature/src/unstable.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,6 @@ declare_features! (
487487
(unstable, derive_from, "1.91.0", Some(144889)),
488488
/// Allows giving non-const impls custom diagnostic messages if attempted to be used as const
489489
(unstable, diagnostic_on_const, "CURRENT_RUSTC_VERSION", Some(143874)),
490-
/// Allows `#[doc(cfg(...))]`.
491-
(unstable, doc_cfg, "1.21.0", Some(43781)),
492490
/// Allows `#[doc(masked)]`.
493491
(unstable, doc_masked, "1.21.0", Some(44027)),
494492
/// Allows features to allow target_feature to better interact with traits.

library/alloc/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,6 @@
192192
#![rustc_preserve_ub_checks]
193193
// tidy-alphabetical-end
194194
//
195-
// Rustdoc features:
196-
#![feature(doc_cfg)]
197195
// Technically, this is a bug in rustdoc: rustdoc sees the documentation on `#[lang = slice_alloc]`
198196
// blocks is for `&[T]`, which also has documentation using this feature in `core`, and gets mad
199197
// that the feature-gate isn't enabled. Ideally, it wouldn't check for the feature gate for docs

library/core/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@
148148
#![feature(deprecated_suggestion)]
149149
#![feature(derive_const)]
150150
#![feature(diagnostic_on_const)]
151-
#![feature(doc_cfg)]
152151
#![feature(doc_notable_trait)]
153152
#![feature(extern_types)]
154153
#![feature(f16)]

library/std/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@
278278
#![feature(core_float_math)]
279279
#![feature(decl_macro)]
280280
#![feature(deprecated_suggestion)]
281-
#![feature(doc_cfg)]
282281
#![feature(doc_masked)]
283282
#![feature(doc_notable_trait)]
284283
#![feature(dropck_eyepatch)]

library/std_detect/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//! * `s390x`: [`is_s390x_feature_detected`]
1616
1717
#![unstable(feature = "stdarch_internal", issue = "none")]
18-
#![feature(staged_api, cfg_select, doc_cfg, allow_internal_unstable)]
18+
#![feature(staged_api, cfg_select, allow_internal_unstable)]
1919
#![deny(rust_2018_idioms)]
2020
#![allow(clippy::shadow_reuse)]
2121
#![cfg_attr(test, allow(unused_imports))]

library/stdarch/crates/core_arch/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
fmt_helpers_for_derive,
1818
rustc_attrs,
1919
staged_api,
20-
doc_cfg,
2120
riscv_target_feature,
2221
arm_target_feature,
2322
mips_target_feature,

src/librustdoc/passes/propagate_doc_cfg.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ pub(crate) const PROPAGATE_DOC_CFG: Pass = Pass {
1717
};
1818

1919
pub(crate) fn propagate_doc_cfg(cr: Crate, cx: &mut DocContext<'_>) -> Crate {
20-
if cx.tcx.features().doc_cfg() {
21-
CfgPropagator { cx, cfg_info: CfgInfo::default() }.fold_crate(cr)
22-
} else {
23-
cr
24-
}
20+
CfgPropagator { cx, cfg_info: CfgInfo::default() }.fold_crate(cr)
2521
}
2622

2723
struct CfgPropagator<'a, 'tcx> {

0 commit comments

Comments
 (0)