From c23cc769eeb2c976c18c715aa416683de583e696 Mon Sep 17 00:00:00 2001 From: Yoshua Wuyts Date: Thu, 26 Sep 2019 16:34:44 +0200 Subject: [PATCH] mark sync::Barrier as unstable Signed-off-by: Yoshua Wuyts --- Cargo.toml | 6 +++--- src/sync/barrier.rs | 2 ++ src/sync/mod.rs | 4 ++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index dd614b1b..43ccc565 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,8 +21,8 @@ features = ["docs"] rustdoc-args = ["--cfg", "feature=\"docs\""] [features] -docs = [] -unstable = [] +docs = ["broadcaster"] +unstable = ["broadcaster"] [dependencies] async-macros = "1.0.0" @@ -42,7 +42,7 @@ num_cpus = "1.10.1" pin-utils = "0.1.0-alpha.4" slab = "0.4.2" kv-log-macro = "1.0.4" -broadcaster = "0.2.4" +broadcaster = { version = "0.2.4", optional = true } [dev-dependencies] femme = "1.2.0" diff --git a/src/sync/barrier.rs b/src/sync/barrier.rs index 40b042c4..d8981a07 100644 --- a/src/sync/barrier.rs +++ b/src/sync/barrier.rs @@ -32,6 +32,7 @@ use crate::sync::Mutex; /// # }); /// # } /// ``` +#[cfg_attr(feature = "docs", doc(cfg(unstable)))] #[derive(Debug)] pub struct Barrier { state: Mutex, @@ -60,6 +61,7 @@ struct BarrierState { /// let barrier = Barrier::new(1); /// let barrier_wait_result = barrier.wait(); /// ``` +#[cfg_attr(feature = "docs", doc(cfg(unstable)))] #[derive(Debug, Clone)] pub struct BarrierWaitResult(bool); diff --git a/src/sync/mod.rs b/src/sync/mod.rs index 99e63c32..df1d71ab 100644 --- a/src/sync/mod.rs +++ b/src/sync/mod.rs @@ -32,10 +32,14 @@ #[doc(inline)] pub use std::sync::{Arc, Weak}; +#[cfg(any(feature = "unstable", feature = "docs"))] pub use barrier::{Barrier, BarrierWaitResult}; + pub use mutex::{Mutex, MutexGuard}; pub use rwlock::{RwLock, RwLockReadGuard, RwLockWriteGuard}; +#[cfg(any(feature = "unstable", feature = "docs"))] +#[cfg_attr(feature = "docs", doc(cfg(unstable)))] mod barrier; mod mutex; mod rwlock;