diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5728b3..0102aa6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,4 +87,4 @@ jobs: run: rustup update nightly && rustup default nightly - run: cargo doc --no-deps --all-features env: - RUSTDOCFLAGS: -Dwarnings + RUSTDOCFLAGS: -Dwarnings --cfg docsrs diff --git a/valuable/Cargo.toml b/valuable/Cargo.toml index 4d7818a..bcbb7d4 100644 --- a/valuable/Cargo.toml +++ b/valuable/Cargo.toml @@ -27,3 +27,7 @@ criterion = "0.3" [[bench]] name = "structable" harness = false + +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] diff --git a/valuable/src/lib.rs b/valuable/src/lib.rs index 7e61b5a..5ba6341 100644 --- a/valuable/src/lib.rs +++ b/valuable/src/lib.rs @@ -96,6 +96,15 @@ //! ``` #![cfg_attr(not(feature = "std"), no_std)] +#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg, doc_cfg_hide))] +#![cfg_attr( + docsrs, + doc(cfg_hide( + not(valuable_no_atomic_cas), + not(valuable_no_atomic), + not(valuable_no_atomic_64) + )) +)] #[cfg(feature = "alloc")] extern crate alloc; @@ -134,4 +143,4 @@ mod visit; pub use visit::{visit, Visit}; #[cfg(feature = "derive")] -pub use valuable_derive::*; +pub use valuable_derive::Valuable;