From cb8f2ceb2eaab72800ecee60a89cbff73c6c79de Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Wed, 23 Sep 2020 05:55:58 +0900 Subject: [PATCH] chore: remove unused future/pending.rs (#2860) --- tokio/src/future/pending.rs | 44 ------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 tokio/src/future/pending.rs diff --git a/tokio/src/future/pending.rs b/tokio/src/future/pending.rs deleted file mode 100644 index 287e836fd..000000000 --- a/tokio/src/future/pending.rs +++ /dev/null @@ -1,44 +0,0 @@ -use sdt::pin::Pin; -use std::future::Future; -use std::marker; -use std::task::{Context, Poll}; - -/// Future for the [`pending()`] function. -#[derive(Debug)] -#[must_use = "futures do nothing unless you `.await` or poll them"] -struct Pending { - _data: marker::PhantomData, -} - -/// Creates a future which never resolves, representing a computation that never -/// finishes. -/// -/// The returned future will forever return [`Poll::Pending`]. -/// -/// # Examples -/// -/// ```no_run -/// use tokio::future; -/// -/// #[tokio::main] -/// async fn main { -/// future::pending().await; -/// unreachable!(); -/// } -/// ``` -pub async fn pending() -> ! { - Pending { - _data: marker::PhantomData, - } - .await -} - -impl Future for Pending { - type Output = !; - - fn poll(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll { - Poll::Pending - } -} - -impl Unpin for Pending {}