diff --git a/src/doc/rustdoc/src/advanced-features.md b/src/doc/rustdoc/src/advanced-features.md index 7c12d23e6495c..c9a0dff5ab303 100644 --- a/src/doc/rustdoc/src/advanced-features.md +++ b/src/doc/rustdoc/src/advanced-features.md @@ -32,3 +32,17 @@ pub struct UnixToken; Here, the respective tokens can only be used by dependent crates on their respective platforms, but they will both appear in documentation. + +## Add aliases for an item in documentation search + +This feature allows you to add alias(es) to an item when using the `rustdoc` search through the +`doc(alias)` attribute. Example: + +```rust,no_run +#[doc(alias = "x")] +#[doc(alias = "big")] +pub struct BigX; +``` + +Then, when looking for it through the `rustdoc` search, if you enter "x" or +"big", search will show the `BigX` struct first. diff --git a/src/doc/rustdoc/src/unstable-features.md b/src/doc/rustdoc/src/unstable-features.md index 84e1ebe5e01f5..e4c5cdce85007 100644 --- a/src/doc/rustdoc/src/unstable-features.md +++ b/src/doc/rustdoc/src/unstable-features.md @@ -174,22 +174,6 @@ issue][issue-include]. [unstable-include]: ../unstable-book/language-features/external-doc.html [issue-include]: https://github.com/rust-lang/rust/issues/44732 -### Add aliases for an item in documentation search - -This feature allows you to add alias(es) to an item when using the `rustdoc` search through the -`doc(alias)` attribute. Example: - -```rust,no_run -#![feature(doc_alias)] - -#[doc(alias = "x")] -#[doc(alias = "big")] -pub struct BigX; -``` - -Then, when looking for it through the `rustdoc` search, if you enter "x" or -"big", search will show the `BigX` struct first. - ## Unstable command-line arguments These features are enabled by passing a command-line flag to Rustdoc, but the flags in question are diff --git a/src/doc/unstable-book/src/language-features/doc-alias.md b/src/doc/unstable-book/src/language-features/doc-alias.md deleted file mode 100644 index 647ac0cf663fd..0000000000000 --- a/src/doc/unstable-book/src/language-features/doc-alias.md +++ /dev/null @@ -1,23 +0,0 @@ -# `doc_alias` - -The tracking issue for this feature is: [#50146] - -[#50146]: https://github.com/rust-lang/rust/issues/50146 - ------------------------- - -You can add alias(es) to an item when using the `rustdoc` search through the -`doc(alias)` attribute. Example: - -```rust,no_run -#![feature(doc_alias)] - -#[doc(alias = "x")] -#[doc(alias = "big")] -pub struct BigX; -``` - -Then, when looking for it through the `rustdoc` search, if you enter "x" or -"big", search will show the `BigX` struct first. - -Note that this feature is currently hidden behind the `feature(doc_alias)` gate. diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index 3b7929f00168a..4627e278a1509 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -120,7 +120,7 @@ #![feature(unsized_locals)] #![feature(untagged_unions)] #![feature(unwind_attributes)] -#![feature(doc_alias)] +#![cfg_attr(bootstrap, feature(doc_alias))] #![feature(mmx_target_feature)] #![feature(tbm_target_feature)] #![feature(sse4a_target_feature)] diff --git a/src/librustc_ast_passes/feature_gate.rs b/src/librustc_ast_passes/feature_gate.rs index 76c790f80b86b..b6ee02e89436c 100644 --- a/src/librustc_ast_passes/feature_gate.rs +++ b/src/librustc_ast_passes/feature_gate.rs @@ -245,7 +245,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { include => external_doc cfg => doc_cfg masked => doc_masked - alias => doc_alias keyword => doc_keyword ); } diff --git a/src/librustc_feature/accepted.rs b/src/librustc_feature/accepted.rs index 18dc3e30db1d4..9cf292c945b8b 100644 --- a/src/librustc_feature/accepted.rs +++ b/src/librustc_feature/accepted.rs @@ -261,6 +261,8 @@ declare_features! ( (accepted, transparent_enums, "1.42.0", Some(60405), None), /// Allows using subslice patterns, `[a, .., b]` and `[a, xs @ .., b]`. (accepted, slice_patterns, "1.42.0", Some(62254), None), + /// Allows `#[doc(alias = "...")]`. + (accepted, doc_alias, "1.45.0", Some(50146), None), // ------------------------------------------------------------------------- // feature-group-end: accepted features diff --git a/src/librustc_feature/active.rs b/src/librustc_feature/active.rs index 7b3c599e8c7ca..374ade8dee757 100644 --- a/src/librustc_feature/active.rs +++ b/src/librustc_feature/active.rs @@ -403,9 +403,6 @@ declare_features! ( /// Allows comparing raw pointers during const eval. (active, const_compare_raw_pointers, "1.27.0", Some(53020), None), - /// Allows `#[doc(alias = "...")]`. - (active, doc_alias, "1.27.0", Some(50146), None), - /// Allows inconsistent bounds in where clauses. (active, trivial_bounds, "1.28.0", Some(48214), None), diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 5fd15bb8fe4f3..a712998eaa9f2 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -254,7 +254,7 @@ #![feature(core_intrinsics)] #![feature(custom_test_frameworks)] #![feature(decl_macro)] -#![feature(doc_alias)] +#![cfg_attr(bootstrap, feature(doc_alias))] #![feature(doc_cfg)] #![feature(doc_keyword)] #![feature(doc_masked)] diff --git a/src/test/ui/feature-gates/feature-gate-doc_alias.rs b/src/test/ui/feature-gates/feature-gate-doc_alias.rs deleted file mode 100644 index c95722102d9b6..0000000000000 --- a/src/test/ui/feature-gates/feature-gate-doc_alias.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[doc(alias = "foo")] //~ ERROR: `#[doc(alias)]` is experimental -pub struct Foo; - -fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-doc_alias.stderr b/src/test/ui/feature-gates/feature-gate-doc_alias.stderr deleted file mode 100644 index f66d1602ba253..0000000000000 --- a/src/test/ui/feature-gates/feature-gate-doc_alias.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0658]: `#[doc(alias)]` is experimental - --> $DIR/feature-gate-doc_alias.rs:1:1 - | -LL | #[doc(alias = "foo")] - | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #50146 for more information - = help: add `#![feature(doc_alias)]` to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`.