Skip to content

Commit 95f9be0

Browse files
stabilize #[doc_alias = "..."]
1 parent d727071 commit 95f9be0

File tree

8 files changed

+16
-64
lines changed

8 files changed

+16
-64
lines changed

src/doc/rustdoc/src/the-doc-attribute.md

+14
Original file line numberDiff line numberDiff line change
@@ -214,3 +214,17 @@ the `strip-hidden` pass is removed.
214214
Since primitive types are defined in the compiler, there's no place to attach documentation
215215
attributes. This attribute is used by the standard library to provide a way to generate
216216
documentation for primitive types.
217+
218+
## `#[doc(alias)]`: Add aliases for an item in documentation search
219+
220+
This feature allows you to add alias(es) to an item when using the `rustdoc` search through the
221+
`doc(alias)` attribute. Example:
222+
223+
```rust,no_run
224+
#[doc(alias = "x")]
225+
#[doc(alias = "big")]
226+
pub struct BigX;
227+
```
228+
229+
Then, when looking for it through the `rustdoc` search, if you enter "x" or
230+
"big", search will show the `BigX` struct first.

src/doc/rustdoc/src/unstable-features.md

-16
Original file line numberDiff line numberDiff line change
@@ -195,22 +195,6 @@ issue][issue-include].
195195
[unstable-include]: ../unstable-book/language-features/external-doc.html
196196
[issue-include]: https://github.com/rust-lang/rust/issues/44732
197197

198-
### Add aliases for an item in documentation search
199-
200-
This feature allows you to add alias(es) to an item when using the `rustdoc` search through the
201-
`doc(alias)` attribute. Example:
202-
203-
```rust,no_run
204-
#![feature(doc_alias)]
205-
206-
#[doc(alias = "x")]
207-
#[doc(alias = "big")]
208-
pub struct BigX;
209-
```
210-
211-
Then, when looking for it through the `rustdoc` search, if you enter "x" or
212-
"big", search will show the `BigX` struct first.
213-
214198
### Include items only when collecting doctests
215199

216200
Rustdoc's [documentation tests] can do some things that regular unit tests can't, so it can

src/doc/unstable-book/src/language-features/doc-alias.md

-23
This file was deleted.

src/libcore/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@
106106
#![feature(unsized_locals)]
107107
#![feature(untagged_unions)]
108108
#![feature(unwind_attributes)]
109-
#![feature(doc_alias)]
110109
#![feature(mmx_target_feature)]
111110
#![feature(tbm_target_feature)]
112111
#![feature(sse4a_target_feature)]

src/libstd/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@
252252
#![feature(const_raw_ptr_deref)]
253253
#![feature(core_intrinsics)]
254254
#![feature(custom_test_frameworks)]
255-
#![feature(doc_alias)]
256255
#![feature(doc_cfg)]
257256
#![feature(doc_keyword)]
258257
#![feature(doc_masked)]

src/libsyntax/feature_gate.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -450,9 +450,6 @@ declare_features! (
450450
// Allows comparing raw pointers during const eval.
451451
(active, const_compare_raw_pointers, "1.27.0", Some(53020), None),
452452

453-
// Allows `#[doc(alias = "...")]`.
454-
(active, doc_alias, "1.27.0", Some(50146), None),
455-
456453
// Allows inconsistent bounds in where clauses.
457454
(active, trivial_bounds, "1.28.0", Some(48214), None),
458455

@@ -854,6 +851,8 @@ declare_features! (
854851
(accepted, repr_align_enum, "1.37.0", Some(57996), None),
855852
// Allows `const _: TYPE = VALUE`.
856853
(accepted, underscore_const_names, "1.37.0", Some(54912), None),
854+
// Allows `#[doc(alias = "...")]`.
855+
(accepted, doc_alias, "1.27.0", Some(50146), None),
857856

858857
// -------------------------------------------------------------------------
859858
// feature-group-end: accepted features
@@ -1887,10 +1886,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
18871886
gate_feature_post!(&self, doc_spotlight, attr.span,
18881887
"`#[doc(spotlight)]` is experimental"
18891888
);
1890-
} else if content.iter().any(|c| c.check_name(sym::alias)) {
1891-
gate_feature_post!(&self, doc_alias, attr.span,
1892-
"`#[doc(alias = \"...\")]` is experimental"
1893-
);
18941889
} else if content.iter().any(|c| c.check_name(sym::keyword)) {
18951890
gate_feature_post!(&self, doc_keyword, attr.span,
18961891
"`#[doc(keyword = \"...\")]` is experimental"

src/test/ui/feature-gates/feature-gate-doc_alias.rs

-4
This file was deleted.

src/test/ui/feature-gates/feature-gate-doc_alias.stderr

-12
This file was deleted.

0 commit comments

Comments
 (0)