Skip to content

Commit

Permalink
Enable doc_cfg and doc_auto_cfg features on docs.rs (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e authored Dec 29, 2021
1 parent 411edef commit c21c67e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions valuable/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ criterion = "0.3"
[[bench]]
name = "structable"
harness = false

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
11 changes: 10 additions & 1 deletion valuable/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -134,4 +143,4 @@ mod visit;
pub use visit::{visit, Visit};

#[cfg(feature = "derive")]
pub use valuable_derive::*;
pub use valuable_derive::Valuable;

0 comments on commit c21c67e

Please sign in to comment.