diff --git a/Cargo.toml b/Cargo.toml index 9583cde..54ab0f1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,10 +22,12 @@ rustdoc-args = ["--cfg", "feature=\"docs\""] [features] default = [] -docs = ["unstable"] +docs = ["unstable", "attributes"] unstable = ["broadcaster"] +attributes = ["async-attributes"] [dependencies] +async-attributes = { version = "1.1.0", optional = true } async-macros = "1.0.0" async-task = "1.0.0" broadcaster = { version = "0.2.6", optional = true, default-features = false, features = ["default-channels"] } diff --git a/src/lib.rs b/src/lib.rs index 4320089..4863cbb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -157,6 +157,19 @@ //! version = "0.99" //! features = ["unstable"] //! ``` +//! +//! Items marked with +//! attributes +//! are available only when the `attributes` Cargo feature is enabled: +//! +//! ```toml +//! [dependencies.async-std] +//! version = "0.99" +//! features = ["attributes"] +//! ``` #![cfg(feature = "default")] #![cfg_attr(feature = "docs", feature(doc_cfg))] @@ -170,6 +183,11 @@ #[macro_use] mod utils; +#[cfg(feature = "attributes")] +#[cfg_attr(feature = "docs", doc(cfg(attributes)))] +#[doc(inline)] +pub use async_attributes::{main, test}; + pub mod fs; pub mod future; pub mod io;