fix pending stabilization

pull/885/head
Yoshua Wuyts 4 years ago
parent 741e9388f3
commit 3a6e75cc1d

@ -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

Loading…
Cancel
Save