diff --git a/src/future/mod.rs b/src/future/mod.rs index 06d06336..cc3b7a5d 100644 --- a/src/future/mod.rs +++ b/src/future/mod.rs @@ -54,18 +54,18 @@ pub use future::Future; pub use pending::pending; pub use poll_fn::poll_fn; pub use ready::ready; +pub use timeout::{timeout, TimeoutError}; pub(crate) mod future; mod pending; mod poll_fn; mod ready; +mod timeout; cfg_if! { if #[cfg(any(feature = "unstable", feature = "docs"))] { mod into_future; - mod timeout; pub use into_future::IntoFuture; - pub use timeout::{timeout, TimeoutError}; } } diff --git a/src/future/timeout.rs b/src/future/timeout.rs index aa88f646..a8338fba 100644 --- a/src/future/timeout.rs +++ b/src/future/timeout.rs @@ -28,8 +28,6 @@ use crate::task::{Context, Poll}; /// # /// # Ok(()) }) } /// ``` -#[cfg_attr(feature = "docs", doc(cfg(unstable)))] -#[cfg(any(feature = "unstable", feature = "docs"))] pub async fn timeout(dur: Duration, f: F) -> Result where F: Future, @@ -42,8 +40,6 @@ where } /// A future that times out after a duration of time. -#[doc(hidden)] -#[allow(missing_debug_implementations)] struct TimeoutFuture { future: F, delay: Delay, @@ -69,8 +65,6 @@ impl Future for TimeoutFuture { } /// An error returned when a future times out. -#[cfg_attr(feature = "docs", doc(cfg(unstable)))] -#[cfg(any(feature = "unstable", feature = "docs"))] #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct TimeoutError { _private: (),