2
0
Fork 1
mirror of https://github.com/async-rs/async-std.git synced 2025-01-16 02:39:55 +00:00

fix pending stabilization

This commit is contained in:
Yoshua Wuyts 2020-09-23 14:23:36 +02:00
parent 741e9388f3
commit 3a6e75cc1d

View file

@ -2,7 +2,11 @@ use core::marker::PhantomData;
use core::pin::Pin; use core::pin::Pin;
use core::task::{Context, Poll}; use core::task::{Context, Poll};
use crate::stream::{DoubleEndedStream, ExactSizeStream, FusedStream, Stream}; cfg_unstable! {
use crate::stream::{DoubleEndedStream, ExactSizeStream, FusedStream};
}
use crate::stream::Stream;
/// A stream that never returns any items. /// A stream that never returns any items.
/// ///
@ -53,14 +57,20 @@ impl<T> Stream for Pending<T> {
} }
} }
#[cfg(feature = "unstable")]
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
impl<T> DoubleEndedStream for Pending<T> { impl<T> DoubleEndedStream for Pending<T> {
fn poll_next_back(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Option<T>> { fn poll_next_back(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Option<T>> {
Poll::Pending Poll::Pending
} }
} }
#[cfg(feature = "unstable")]
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
impl<T> FusedStream for Pending<T> {} impl<T> FusedStream for Pending<T> {}
#[cfg(feature = "unstable")]
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
impl<T> ExactSizeStream for Pending<T> { impl<T> ExactSizeStream for Pending<T> {
fn len(&self) -> usize { fn len(&self) -> usize {
0 0