Skip to content

Commit

Permalink
Add link to async/await
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Oct 22, 2019
1 parent 4fcc784 commit a1f6589
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/librustc/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2127,7 +2127,7 @@ static X: u32 = 42;
"##,

E0728: r##"
`await` has been used outside `async` function or block.
[`await`] has been used outside [`async`] function or block.
Erroneous code examples:
Expand Down Expand Up @@ -2160,9 +2160,9 @@ fn foo() {
}
```
`await` is used to suspend the current computation until the given
[`await`] is used to suspend the current computation until the given
future is ready to produce a value. So it is legal only within
an async context, like an `async fn` or an `async` block.
an [`async`] context, like an `async fn` or an `async` block.
```edition2018
# use std::pin::Pin;
Expand Down Expand Up @@ -2199,6 +2199,9 @@ fn bar(x: u8) -> impl Future<Output = u8> {
}
}
```
[`async`]: https://doc.rust-lang.org/std/keyword.async.html
[`await`]: https://doc.rust-lang.org/std/keyword.await.html
"##,

E0734: r##"
Expand Down

0 comments on commit a1f6589

Please sign in to comment.