mirror of
https://github.com/async-rs/async-std.git
synced 2025-01-30 09:15:33 +00:00
fix pending stabilization
This commit is contained in:
parent
741e9388f3
commit
3a6e75cc1d
1 changed files with 11 additions and 1 deletions
|
@ -2,7 +2,11 @@ use core::marker::PhantomData;
|
|||
use core::pin::Pin;
|
||||
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.
|
||||
///
|
||||
|
@ -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> {
|
||||
fn poll_next_back(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Option<T>> {
|
||||
Poll::Pending
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "unstable")]
|
||||
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
|
||||
impl<T> FusedStream for Pending<T> {}
|
||||
|
||||
#[cfg(feature = "unstable")]
|
||||
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
|
||||
impl<T> ExactSizeStream for Pending<T> {
|
||||
fn len(&self) -> usize {
|
||||
0
|
||||
|
|
Loading…
Reference in a new issue