@@ -1149,20 +1149,39 @@ mod where_keyword {}
1149
1149
//
1150
1150
/// Return a [`Future`] instead of blocking the current thread.
1151
1151
///
1152
- /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
1152
+ /// Use `async` in front of `fn`, `closure`, or a `block` to turn the marked code into a `Future`.
1153
+ /// As such the code will not be run immediately, but will only be evaluated when the returned
1154
+ /// future is `.await`ed.
1155
+ ///
1156
+ /// We have written an [async book] detailing async/await and trade-offs compared to using threads.
1157
+ ///
1158
+ /// ## Editions
1159
+ ///
1160
+ /// `async` is a keyword from the 2018 edition onwards.
1161
+ ///
1162
+ /// It is available for use in stable rust from version 1.39 onwards.
1153
1163
///
1154
1164
/// [`Future`]: ./future/trait.Future.html
1155
- /// [not yet complete ]: https://github.com/rust-lang/rust/issues/34601
1165
+ /// [async book ]: https://rust-lang. github.io/async-book/
1156
1166
mod async_keyword { }
1157
1167
1158
1168
#[ doc( keyword = "await" ) ]
1159
1169
//
1160
1170
/// Suspend execution until the result of a [`Future`] is ready.
1161
1171
///
1162
- /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
1172
+ /// `.await`ing a future will suspend the current function's execution until the `executor`
1173
+ /// has run the future to completion.
1174
+ ///
1175
+ /// Read the [async book] for details on how async/await and executors work.
1176
+ ///
1177
+ /// ## Editions
1178
+ ///
1179
+ /// `await` is a keyword from the 2018 edition onwards.
1180
+ ///
1181
+ /// It is available for use in stable rust from version 1.39 onwards.
1163
1182
///
1164
1183
/// [`Future`]: ./future/trait.Future.html
1165
- /// [not yet complete ]: https://github.com/rust-lang/rust/issues/34601
1184
+ /// [async book ]: https://rust-lang. github.io/async-book/
1166
1185
mod await_keyword { }
1167
1186
1168
1187
#[ doc( keyword = "dyn" ) ]
0 commit comments