Rollup merge of #69477 - Pulkit07:issue69298, r=cramertj
docs: add mention of async blocks in move keyword docs Fixes #69298
This commit is contained in:
commit
222aa62008
1 changed files with 9 additions and 0 deletions
|
@ -895,6 +895,15 @@ mod mod_keyword {}
|
||||||
/// // x is no longer available
|
/// // 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
|
/// For more information on the `move` keyword, see the [closure]'s section
|
||||||
/// of the Rust book or the [threads] section
|
/// of the Rust book or the [threads] section
|
||||||
///
|
///
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue