about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-02-29 02:16:17 +0100
committerGitHub <noreply@github.com>2020-02-29 02:16:17 +0100
commit222aa620087935fcad282ddd1161831b4037d41f (patch)
tree4959228ee91b59c9994bed945fb34cf813b5d5d1 /src/libstd
parent0eb878d2aa6e3a1cb315f3f328681b26bb4bffdb (diff)
parent299a0d559f574f1ca1092a3783f00adba68be290 (diff)
downloadrust-222aa620087935fcad282ddd1161831b4037d41f.tar.gz
rust-222aa620087935fcad282ddd1161831b4037d41f.zip
Rollup merge of #69477 - Pulkit07:issue69298, r=cramertj
docs: add mention of async blocks in move keyword docs

Fixes #69298
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/keyword_docs.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libstd/keyword_docs.rs b/src/libstd/keyword_docs.rs
index 58f4e76cd30..3c69c1160d5 100644
--- a/src/libstd/keyword_docs.rs
+++ b/src/libstd/keyword_docs.rs
@@ -895,6 +895,15 @@ mod mod_keyword {}
 /// // x is no longer available
 /// ```
 ///
+/// `move` is also valid before an async block.
+///
+/// ```rust
+/// let capture = "hello";
+/// let block = async move {
+///     println!("rust says {} from async block", capture);
+/// };
+/// ```
+///
 /// For more information on the `move` keyword, see the [closure]'s section
 /// of the Rust book or the [threads] section
 ///