Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some keyword documentation. #67622

Merged
merged 1 commit into from
Dec 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions src/libstd/keyword_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1149,20 +1149,39 @@ mod where_keyword {}
//
/// Return a [`Future`] instead of blocking the current thread.
///
/// The documentation for this keyword is [not yet complete]. Pull requests welcome!
/// Use `async` in front of `fn`, `closure`, or a `block` to turn the marked code into a `Future`.
/// As such the code will not be run immediately, but will only be evaluated when the returned
/// future is `.await`ed.
///
/// We have written an [async book] detailing async/await and trade-offs compared to using threads.
///
/// ## Editions
///
/// `async` is a keyword from the 2018 edition onwards.
///
/// It is available for use in stable rust from version 1.39 onwards.
///
/// [`Future`]: ./future/trait.Future.html
/// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
/// [async book]: https://rust-lang.github.io/async-book/
mod async_keyword {}

#[doc(keyword = "await")]
//
/// Suspend execution until the result of a [`Future`] is ready.
///
/// The documentation for this keyword is [not yet complete]. Pull requests welcome!
/// `.await`ing a future will suspend the current function's execution until the `executor`
/// has run the future to completion.
///
/// Read the [async book] for details on how async/await and executors work.
///
/// ## Editions
///
/// `await` is a keyword from the 2018 edition onwards.
///
/// It is available for use in stable rust from version 1.39 onwards.
///
/// [`Future`]: ./future/trait.Future.html
/// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
/// [async book]: https://rust-lang.github.io/async-book/
mod await_keyword {}

#[doc(keyword = "dyn")]
Expand Down