about summary refs log tree commit diff
path: root/src/doc/rustdoc
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-04-18 06:44:45 +0200
committerGitHub <noreply@github.com>2023-04-18 06:44:45 +0200
commitafea84f99c8c9a7bb7c7afb22bc1d5aceceb1a8d (patch)
tree3e2bc004b21ac36c5cb8b2775c7a22c80d3ac4bb /src/doc/rustdoc
parent06d403d67076dabd263ff038979f791b07853a3f (diff)
parent1531c95c5d3f4e9ef4cfc122c35947e7b9cca53e (diff)
Rollup merge of #110348 - GuillaumeGomez:disambiguators-suffixes-rustdoc-book, r=Manishearth
Add list of supported disambiguators and suffixes for intra-doc links in the rustdoc book

This information is otherwise only provided in case an error occurs, which isn't great.

r? ```@notriddle```
Diffstat (limited to 'src/doc/rustdoc')
-rw-r--r--src/doc/rustdoc/src/write-documentation/linking-to-items-by-name.md9
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()`]