diff options
author | Alice Ryhl <alice@ryhl.io> | 2020-10-02 06:13:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-01 21:13:28 -0700 |
commit | 7ec6d88b21ea3e5531176f526a51dae0a4513025 (patch) | |
tree | 6b4f289567fce7033551910c684c8358da4a58d8 /tokio/tests | |
parent | 13de30c53eb90a5453f1cecf47b188e254a293ac (diff) |
chore: make #[doc(hidden)] apis private (#2901)
Diffstat (limited to 'tokio/tests')
-rw-r--r-- | tokio/tests/sync_oneshot.rs | 13 | ||||
-rw-r--r-- | tokio/tests/time_interval.rs | 8 |
2 files changed, 20 insertions, 1 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(); diff --git a/tokio/tests/time_interval.rs b/tokio/tests/time_interval.rs index 1123681f..5ac6ae69 100644 --- a/tokio/tests/time_interval.rs +++ b/tokio/tests/time_interval.rs @@ -4,6 +4,7 @@ use tokio::time::{self, Duration, Instant}; use tokio_test::{assert_pending, assert_ready_eq, task}; +use std::future::Future; use std::task::Poll; #[tokio::test] @@ -58,7 +59,12 @@ async fn usage_stream() { } fn poll_next(interval: &mut task::Spawn<time::Interval>) -> Poll<Instant> { - interval.enter(|cx, mut interval| interval.poll_tick(cx)) + interval.enter(|cx, mut interval| { + tokio::pin! { + let fut = interval.tick(); + } + fut.poll(cx) + }) } fn ms(n: u64) -> Duration { |