Skip to content

Commit 841761e

Browse files
jyn514camelid
andauthored
Apply suggestions from code review
Co-authored-by: Camelid <37223377+camelid@users.noreply.github.com>
1 parent e698222 commit 841761e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

posts/inside-rust/2020-09-11-stabilizing-intra-doc-links.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,18 @@ author: Manish Goregaokar and Joshua Nelson
44
team: the rustdoc team <https://www.rust-lang.org/governance/teams/dev-tools#rustdoc>
55
---
66

7-
# Intra-doc links close to stabilization
8-
97
We're excited to share that intra-doc links are stabilizing soon!
108

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:
1210

1311
```rust
1412
/// Link to [`f()`]
1513
pub struct S;
14+
1615
pub fn f() {}
1716
```
1817

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.
2019

2120
## The history of intra-doc links
2221

@@ -72,10 +71,10 @@ thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', /home/
7271

7372
## HirIds and DefIds and trees, oh my!
7473

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.)
7675

7776
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:
7978

8079
```rust
8180
fn main() {

0 commit comments

Comments
 (0)