Skip to content

Commit d81e8f0

Browse files
authored
macros: remove (most) local use declarations in tokio::select! (#7929)
1 parent 25e7f26 commit d81e8f0

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

tokio/src/macros/select.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -615,9 +615,7 @@ doc! {macro_rules! select {
615615

616616
// `tokio::macros::support` is a public, but doc(hidden) module
617617
// including a re-export of all types needed by this macro.
618-
use $crate::macros::support::Future;
619618
use $crate::macros::support::Pin;
620-
use $crate::macros::support::Poll::{Ready, Pending};
621619

622620
const BRANCHES: u32 = $crate::count!( $($count)* );
623621

@@ -704,9 +702,9 @@ doc! {macro_rules! select {
704702
let mut fut = unsafe { Pin::new_unchecked(fut) };
705703

706704
// Try polling it
707-
let out = match Future::poll(fut, cx) {
708-
Ready(out) => out,
709-
Pending => {
705+
let out = match $crate::macros::support::Future::poll(fut, cx) {
706+
$crate::macros::support::Poll::Ready(out) => out,
707+
$crate::macros::support::Poll::Pending => {
710708
// Track that at least one future is
711709
// still pending and continue polling.
712710
is_pending = true;
@@ -727,18 +725,18 @@ doc! {macro_rules! select {
727725
}
728726

729727
// The select is complete, return the value
730-
return Ready($crate::select_variant!(__tokio_select_util::Out, ($($skip)*))(out));
728+
return $crate::macros::support::Poll::Ready($crate::select_variant!(__tokio_select_util::Out, ($($skip)*))(out));
731729
}
732730
)*
733731
_ => unreachable!("reaching this means there probably is an off by one bug"),
734732
}
735733
}
736734

737735
if is_pending {
738-
Pending
736+
$crate::macros::support::Poll::Pending
739737
} else {
740738
// All branches have been disabled.
741-
Ready(__tokio_select_util::Out::Disabled)
739+
$crate::macros::support::Poll::Ready(__tokio_select_util::Out::Disabled)
742740
}
743741
}).await
744742
};

0 commit comments

Comments
 (0)