diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2023-04-15 12:07:30 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2023-04-17 11:09:24 +0200 |
| commit | a091fd25cae34ebdc3f158e623743d51428952ff (patch) | |
| tree | 1ed87441667182ec2891362fa4fbe142d184a06c | |
| parent | d38fd29b5b2ed78ef801af19f8b6e6ae98f24210 (diff) | |
| download | rust-a091fd25cae34ebdc3f158e623743d51428952ff.tar.gz rust-a091fd25cae34ebdc3f158e623743d51428952ff.zip | |
Add list of supported disambiguators and suffixes for intra-doc links in the rustdoc book
| -rw-r--r-- | src/doc/rustdoc/src/write-documentation/linking-to-items-by-name.md | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/doc/rustdoc/src/write-documentation/linking-to-items-by-name.md b/src/doc/rustdoc/src/write-documentation/linking-to-items-by-name.md index eb2285ef906..72157b5cd9b 100644 --- a/src/doc/rustdoc/src/write-documentation/linking-to-items-by-name.md +++ b/src/doc/rustdoc/src/write-documentation/linking-to-items-by-name.md @@ -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()`] |
