From a1f65895a071885141061590e24022eacec6e858 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Tue, 22 Oct 2019 21:10:51 +0900 Subject: [PATCH] Add link to async/await --- src/librustc/error_codes.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/librustc/error_codes.rs b/src/librustc/error_codes.rs index 4ee3445235ee9..122ae4a6cf66f 100644 --- a/src/librustc/error_codes.rs +++ b/src/librustc/error_codes.rs @@ -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: @@ -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; @@ -2199,6 +2199,9 @@ fn bar(x: u8) -> impl Future { } } ``` + +[`async`]: https://doc.rust-lang.org/std/keyword.async.html +[`await`]: https://doc.rust-lang.org/std/keyword.await.html "##, E0734: r##"