Skip to content

Commit a091fd2

Browse files
Add list of supported disambiguators and suffixes for intra-doc links in the rustdoc book
1 parent d38fd29 commit a091fd2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/doc/rustdoc/src/write-documentation/linking-to-items-by-name.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,16 @@ fn Foo() {}
8888
```
8989

9090
These prefixes will be stripped when displayed in the documentation, so `[struct@Foo]` will be
91-
rendered as `Foo`.
91+
rendered as `Foo`. The following prefixes are available: `struct`, `enum`, `trait`, `union`,
92+
`mod`, `module`, `const`, `constant`, `fn`, `function`, `method`, `derive`, `type`, `value`,
93+
`macro`, `prim` or `primitive`.
9294

9395
You can also disambiguate for functions by adding `()` after the function name,
94-
or for macros by adding `!` after the macro name:
96+
or for macros by adding `!` after the macro name. The macro `!` can be followed by `()`, `{}`,
97+
or `[]`. Example:
9598

9699
```rust
97-
/// This is different from [`foo!`]
100+
/// This is different from [`foo!()`].
98101
fn foo() {}
99102

100103
/// This is different from [`foo()`]

0 commit comments

Comments
 (0)