Skip to content

Put everything behind a 'stable' feature to avoid future breaking changes #434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 2, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ features = ["docs"]
rustdoc-args = ["--cfg", "feature=\"docs\""]

[features]
default = ["stable"]
default = []
docs = ["unstable"]
unstable = ["broadcaster"]
stable = []

[dependencies]
async-macros = "1.0.0"
Expand Down
64 changes: 26 additions & 38 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
//! features = ["unstable"]
//! ```

#![cfg(feature = "default")]
#![cfg_attr(feature = "docs", feature(doc_cfg))]
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
#![allow(clippy::mutex_atomic, clippy::module_inception)]
Expand All @@ -49,46 +50,33 @@
#![doc(html_logo_url = "https://async.rs/images/logo--hero.svg")]
#![recursion_limit = "2048"]

/// Declares stable items.
#[doc(hidden)]
macro_rules! cfg_stable {
($($item:item)*) => {
$(
#[cfg(feature = "stable")]
$item
)*
}
}

cfg_stable! {
#[macro_use]
mod utils;
#[macro_use]
mod utils;

pub mod fs;
pub mod future;
pub mod io;
pub mod net;
pub mod os;
pub mod path;
pub mod prelude;
pub mod stream;
pub mod sync;
pub mod task;
pub mod fs;
pub mod future;
pub mod io;
pub mod net;
pub mod os;
pub mod path;
pub mod prelude;
pub mod stream;
pub mod sync;
pub mod task;

cfg_unstable! {
pub mod pin;
pub mod process;
cfg_unstable! {
pub mod pin;
pub mod process;

mod unit;
mod vec;
mod result;
mod option;
mod string;
mod collections;
mod unit;
mod vec;
mod result;
mod option;
mod string;
mod collections;

#[doc(inline)]
pub use std::{write, writeln};
}

mod macros;
#[doc(inline)]
pub use std::{write, writeln};
}

mod macros;
2 changes: 2 additions & 0 deletions src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ pub use crate::io::Seek as _;
pub use crate::io::Write as _;
#[doc(no_inline)]
pub use crate::stream::Stream;
#[doc(no_inline)]
pub use crate::task_local;

#[doc(hidden)]
pub use crate::future::future::FutureExt as _;
Expand Down