Add list of supported disambiguators and suffixes for intra-doc links in the rustdoc book

This commit is contained in:
Guillaume Gomez 2023-04-15 12:07:30 +02:00
parent d38fd29b5b
commit a091fd25ca

View File

@ -88,13 +88,16 @@ fn Foo() {}
```
These prefixes will be stripped when displayed in the documentation, so `[struct@Foo]` will be
rendered as `Foo`.
rendered as `Foo`. The following prefixes are available: `struct`, `enum`, `trait`, `union`,
`mod`, `module`, `const`, `constant`, `fn`, `function`, `method`, `derive`, `type`, `value`,
`macro`, `prim` or `primitive`.
You can also disambiguate for functions by adding `()` after the function name,
or for macros by adding `!` after the macro name:
or for macros by adding `!` after the macro name. The macro `!` can be followed by `()`, `{}`,
or `[]`. Example:
```rust
/// This is different from [`foo!`]
/// This is different from [`foo!()`].
fn foo() {}
/// This is different from [`foo()`]