From 7329178ab683244623756d95d3b24572f8778953 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 3 Aug 2019 13:48:31 +0200 Subject: [PATCH] Add doc-alias documentation --- src/attributes/doc-alias.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/attributes/doc-alias.md diff --git a/src/attributes/doc-alias.md b/src/attributes/doc-alias.md new file mode 100644 index 000000000..647ac0cf6 --- /dev/null +++ b/src/attributes/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.