Skip to content

Commit

Permalink
Mention URL fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Sep 14, 2020
1 parent bc06674 commit f072e4a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/doc/rustdoc/src/linking-to-items-by-name.md
Expand Up @@ -41,6 +41,15 @@ impl<T> AsyncReceiver<T> {
}
```

You can also link to sections using URL fragment specifiers:

```rust
/// This is a special implementation of [positional parameters]
///
/// [positional parameters]: std::fmt#formatting-parameters
struct MySpecialFormatter;
```

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@`:

```rust
Expand Down

0 comments on commit f072e4a

Please sign in to comment.