Skip to content

Commit

Permalink
Add doc about doc alias feature
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Apr 21, 2018
1 parent 48ab422 commit 1ed3e77
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/doc/rustdoc/src/unstable-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
23 changes: 23 additions & 0 deletions src/doc/unstable-book/src/language-features/doc-alias.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 1ed3e77

Please sign in to comment.