macros: improve documentation for select! (#6774)

This commit is contained in:
Rafael Bachmann 2024-08-14 14:49:28 +01:00 committed by GitHub
parent 694577fa85
commit 39c3c19bbd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,13 +39,13 @@ macro_rules! doc {
/// 2. Aggregate the `<async expression>`s from each branch, including the /// 2. Aggregate the `<async expression>`s from each branch, including the
/// disabled ones. If the branch is disabled, `<async expression>` is still /// disabled ones. If the branch is disabled, `<async expression>` is still
/// evaluated, but the resulting future is not polled. /// evaluated, but the resulting future is not polled.
/// 3. Concurrently await on the results for all remaining `<async expression>`s. /// 3. If **all** branches are disabled: go to step 6.
/// 4. Once an `<async expression>` returns a value, attempt to apply the value /// 4. Concurrently await on the results for all remaining `<async expression>`s.
/// to the provided `<pattern>`, if the pattern matches, evaluate `<handler>` /// 5. Once an `<async expression>` returns a value, attempt to apply the value to the
/// and return. If the pattern **does not** match, disable the current branch /// provided `<pattern>`. If the pattern matches, evaluate the `<handler>` and return.
/// and for the remainder of the current call to `select!`. Continue from step 3. /// If the pattern **does not** match, disable the current branch for the remainder of
/// 5. If **all** branches are disabled, evaluate the `else` expression. If no /// the current call to `select!`. Continue from step 3.
/// else branch is provided, panic. /// 6. Evaluate the `else` expression. If no else expression is provided, panic.
/// ///
/// # Runtime characteristics /// # Runtime characteristics
/// ///