From 7ec6d88b21ea3e5531176f526a51dae0a4513025 Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Fri, 2 Oct 2020 06:13:28 +0200 Subject: chore: make #[doc(hidden)] apis private (#2901) --- tokio/tests/sync_oneshot.rs | 13 +++++++++++++ tokio/tests/time_interval.rs | 8 +++++++- 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'tokio/tests') 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 {} impl AssertSend for oneshot::Receiver {} +trait SenderExt { + fn poll_closed(&mut self, cx: &mut Context<'_>) -> Poll<()>; +} +impl SenderExt for oneshot::Sender { + 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) -> Poll { - 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 { -- cgit v1.2.3