diff options
Diffstat (limited to 'tokio/tests/sync_oneshot.rs')
-rw-r--r-- | tokio/tests/sync_oneshot.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tokio/tests/sync_oneshot.rs b/tokio/tests/sync_oneshot.rs index 13e526d4..195c2553 100644 --- a/tokio/tests/sync_oneshot.rs +++ b/tokio/tests/sync_oneshot.rs @@ -6,11 +6,24 @@ use tokio_test::*; use std::future::Future; use std::pin::Pin; +use std::task::{Context, Poll}; trait AssertSend: Send {} impl AssertSend for oneshot::Sender<i32> {} impl AssertSend for oneshot::Receiver<i32> {} +trait SenderExt { + fn poll_closed(&mut self, cx: &mut Context<'_>) -> Poll<()>; +} +impl<T> SenderExt for oneshot::Sender<T> { + fn poll_closed(&mut self, cx: &mut Context<'_>) -> Poll<()> { + tokio::pin! { + let fut = self.closed(); + } + fut.poll(cx) + } +} + #[test] fn send_recv() { let (tx, rx) = oneshot::channel(); |