Skip to content

Commit

Permalink
macros: render more comprehensible documentation for select! macro
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Apr 6, 2024
1 parent 01ed7b5 commit 493fcb3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tokio/src/macros/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,27 @@
/// }
/// }
/// ```
#[cfg(doc)]
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "macros")))]
macro_rules! select {
{
$(
biased;
)?
$(
$bind:pat = $fut:expr $(, if $cond:expr)? => $handler:expr /*optional comma*/,
)*
$(
else => $els:expr $(,)?
)?
} => {
unimplemented!()
};
}

#[cfg(not(doc))]
#[macro_export]
macro_rules! select {
// Uses a declarative macro to do **most** of the work. While it is possible
// to implement fully with a declarative macro, a procedural macro is used
Expand Down

0 comments on commit 493fcb3

Please sign in to comment.