Skip to content

Commit a1f6589

Browse files
committed
Add link to async/await
1 parent 4fcc784 commit a1f6589

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/librustc/error_codes.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -2127,7 +2127,7 @@ static X: u32 = 42;
21272127
"##,
21282128

21292129
E0728: r##"
2130-
`await` has been used outside `async` function or block.
2130+
[`await`] has been used outside [`async`] function or block.
21312131
21322132
Erroneous code examples:
21332133
@@ -2160,9 +2160,9 @@ fn foo() {
21602160
}
21612161
```
21622162
2163-
`await` is used to suspend the current computation until the given
2163+
[`await`] is used to suspend the current computation until the given
21642164
future is ready to produce a value. So it is legal only within
2165-
an async context, like an `async fn` or an `async` block.
2165+
an [`async`] context, like an `async fn` or an `async` block.
21662166
21672167
```edition2018
21682168
# use std::pin::Pin;
@@ -2199,6 +2199,9 @@ fn bar(x: u8) -> impl Future<Output = u8> {
21992199
}
22002200
}
22012201
```
2202+
2203+
[`async`]: https://doc.rust-lang.org/std/keyword.async.html
2204+
[`await`]: https://doc.rust-lang.org/std/keyword.await.html
22022205
"##,
22032206

22042207
E0734: r##"

0 commit comments

Comments
 (0)