Skip to content

Commit e36a370

Browse files
jyn514GuillaumeGomez
authored andcommitted
Add test case for doc_cfg_hide feature gate
1 parent 0031ce3 commit e36a370

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

compiler/rustc_feature/src/active.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,6 @@ declare_features! (
380380
/// Allows `#[doc(cfg(...))]`.
381381
(active, doc_cfg, "1.21.0", Some(43781), None),
382382

383-
/// Allows `#[doc(cfg_hide(...))]`.
384-
(active, doc_cfg_hide, "1.49.0", Some(43781), None),
385-
386383
/// Allows `#[doc(masked)]`.
387384
(active, doc_masked, "1.21.0", Some(44027), None),
388385

@@ -678,6 +675,9 @@ declare_features! (
678675
/// Allows `#[track_caller]` on closures and generators.
679676
(active, closure_track_caller, "1.57.0", Some(87417), None),
680677

678+
/// Allows `#[doc(cfg_hide(...))]`.
679+
(active, doc_cfg_hide, "1.53.0", Some(43781), None),
680+
681681
// -------------------------------------------------------------------------
682682
// feature-group-end: actual feature gates
683683
// -------------------------------------------------------------------------
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#![doc(cfg_hide(test))]
2+
//~^ ERROR `#[doc(cfg_hide)]` is experimental
3+
4+
#[cfg(not(test))]
5+
pub fn public_fn() {}
6+
#[cfg(test)]
7+
pub fn internal_use_only() {}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error[E0658]: `#[doc(cfg_hide)]` is experimental
2+
--> $DIR/feature-gate-doc_cfg_hide.rs:1:1
3+
|
4+
LL | #![doc(cfg_hide(test))]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: see issue #43781 <https://github.com/rust-lang/rust/issues/43781> for more information
8+
= help: add `#![feature(doc_cfg_hide)]` to the crate attributes to enable
9+
10+
error: Compilation failed, aborting rustdoc
11+
12+
error: aborting due to 2 previous errors
13+
14+
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)