diff options
author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2018-04-21 22:41:08 +0200 |
---|---|---|
committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2018-04-22 00:30:48 +0200 |
commit | 1ed3e77b8a254fd9cbf8f922d1f910d375a9d1e4 (patch) | |
tree | f03d45f27b41121e4dcbf654b15ff18e2f7f22fc | |
parent | 48ab422be4cbc3ab4eb5d3456c2b92ccfe9d7f8d (diff) | |
download | rust-1ed3e77b8a254fd9cbf8f922d1f910d375a9d1e4.tar.gz |
Add doc about doc alias feature
-rw-r--r-- | src/doc/rustdoc/src/unstable-features.md | 16 | ||||
-rw-r--r-- | src/doc/unstable-book/src/language-features/doc-alias.md | 23 |
2 files changed, 39 insertions, 0 deletions
diff --git a/src/doc/rustdoc/src/unstable-features.md b/src/doc/rustdoc/src/unstable-features.md index bf97fb46861..7f110d6a3d2 100644 --- a/src/doc/rustdoc/src/unstable-features.md +++ b/src/doc/rustdoc/src/unstable-features.md @@ -373,3 +373,19 @@ This is an internal flag intended for the standard library and compiler that app `#[unstable]` attribute to any dependent crate that doesn't have another stability attribute. This allows `rustdoc` to be able to generate documentation for the compiler crates and the standard library, as an equivalent command-line argument is provided to `rustc` when building those crates. + +### `doc_alias` feature + +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. diff --git a/src/doc/unstable-book/src/language-features/doc-alias.md b/src/doc/unstable-book/src/language-features/doc-alias.md new file mode 100644 index 00000000000..647ac0cf663 --- /dev/null +++ b/src/doc/unstable-book/src/language-features/doc-alias.md @@ -0,0 +1,23 @@ +# `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. |