You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: posts/inside-rust/2020-09-11-stabilizing-intra-doc-links.md
+5-6Lines changed: 5 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -4,19 +4,18 @@ author: Manish Goregaokar and Joshua Nelson
4
4
team: the rustdoc team <https://www.rust-lang.org/governance/teams/dev-tools#rustdoc>
5
5
---
6
6
7
-
# Intra-doc links close to stabilization
8
-
9
7
We're excited to share that intra-doc links are stabilizing soon!
10
8
11
-
[Intra-doc links] are a feature of `rustdoc` that allow you to link to '[items]' - functions, types, and more - by their name, instead of a hard-coded url. This lets you have accurate links even if your types are [re-exported in a different module or crate][broken-string-links]. Here is a simple example:
9
+
[Intra-doc links] are a feature of `rustdoc` that allow you to link to '[items]' - functions, types, and more - by their name, instead of a hard-coded URL. This lets you have accurate links even if your types are [re-exported in a different module or crate][broken-string-links]. Here is a simple example:
12
10
13
11
```rust
14
12
/// Link to [`f()`]
15
13
pubstructS;
14
+
16
15
pubfnf() {}
17
16
```
18
17
19
-
Intra-doc links have been around for a while, all the way back [since 2017][tracking-issue]! They have been available on `nightly` without flags (and thus, on docs.rs), so you may be surprised to hear that they weren't yet stable. What's changing now is that they will be available on stable Rust, which also means we are more confident in the implementation and would strongly encourage their use. We recommend that you switch your libraries to use intra-doc links, which will fix broken links for re-exported types and links to different crates. We hope to add support for automating this process with [`cargo fix`] in the future.
18
+
Intra-doc links have been around for a while, all the way back [since 2017][tracking-issue]! They have been available on `nightly` without flags (and thus, on [docs.rs](https://docs.rs)), so you may be surprised to hear that they weren't yet stable. What's changing now is that they will be available on stable Rust, which also means we are more confident in the implementation and would strongly encourage their use. We recommend that you switch your libraries to use intra-doc links, which will fix broken links for re-exported types and links to different crates. We hope to add support for automating this process with [`cargo fix`] in the future.
20
19
21
20
## The history of intra-doc links
22
21
@@ -72,10 +71,10 @@ thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', /home/
72
71
73
72
## HirIds and DefIds and trees, oh my!
74
73
75
-
(If you're not interested in the internals of the rust compiler, feel free to skip this section.)
74
+
(If you're not interested in the internals of the Rust compiler, feel free to skip this section.)
76
75
77
76
The error above came because of a pass called [`everybody_loops`]. A compiler 'pass' is a transformation on the source code, for example [finding items without documentation][missing_docs].
78
-
The `everybody_loops` pass turns the above code into
77
+
The `everybody_loops` pass turns the above code into:
0 commit comments