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 {}