Skip to content

Commit f072e4a

Browse files
committed
Mention URL fragments
1 parent bc06674 commit f072e4a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ impl<T> AsyncReceiver<T> {
4141
}
4242
```
4343

44+
You can also link to sections using URL fragment specifiers:
45+
46+
```rust
47+
/// This is a special implementation of [positional parameters]
48+
///
49+
/// [positional parameters]: std::fmt#formatting-parameters
50+
struct MySpecialFormatter;
51+
```
52+
4453
Paths in Rust have three namespaces: type, value, and macro. Items from these namespaces are allowed to overlap. In case of ambiguity, rustdoc will warn about the ambiguity and ask you to disambiguate, which can be done by using a prefix like `struct@`, `enum@`, `type@`, `trait@`, `union@`, `const@`, `static@`, `value@`, `function@`, `mod@`, `fn@`, `module@`, `method@` , `macro@`, or `derive@`:
4554

4655
```rust

0 commit comments

Comments
 (0)