File tree 2 files changed +39
-0
lines changed
unstable-book/src/language-features
2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -373,3 +373,19 @@ This is an internal flag intended for the standard library and compiler that app
373
373
` #[unstable] ` attribute to any dependent crate that doesn't have another stability attribute. This
374
374
allows ` rustdoc ` to be able to generate documentation for the compiler crates and the standard
375
375
library, as an equivalent command-line argument is provided to ` rustc ` when building those crates.
376
+
377
+ ### ` doc_alias ` feature
378
+
379
+ This feature allows you to add alias(es) to an item when using the ` rustdoc ` search through the
380
+ ` doc(alias) ` attribute. Example:
381
+
382
+ ``` rust,no_run
383
+ #![feature(doc_alias)]
384
+
385
+ #[doc(alias = "x")]
386
+ #[doc(alias = "big")]
387
+ pub struct BigX;
388
+ ```
389
+
390
+ Then, when looking for it through the ` rustdoc ` search, if you enter "x" or
391
+ "big", search will show the ` BigX ` struct first.
Original file line number Diff line number Diff line change
1
+ # ` doc_alias `
2
+
3
+ The tracking issue for this feature is: [ #50146 ]
4
+
5
+ [ #50146 ] : https://github.com/rust-lang/rust/issues/50146
6
+
7
+ ------------------------
8
+
9
+ You can add alias(es) to an item when using the ` rustdoc ` search through the
10
+ ` doc(alias) ` attribute. Example:
11
+
12
+ ``` rust,no_run
13
+ #![feature(doc_alias)]
14
+
15
+ #[doc(alias = "x")]
16
+ #[doc(alias = "big")]
17
+ pub struct BigX;
18
+ ```
19
+
20
+ Then, when looking for it through the ` rustdoc ` search, if you enter "x" or
21
+ "big", search will show the ` BigX ` struct first.
22
+
23
+ Note that this feature is currently hidden behind the ` feature(doc_alias) ` gate.
You can’t perform that action at this time.
0 commit comments