diff --git a/Cargo.toml b/Cargo.toml index 0605714..51a69c6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,10 @@ repository = "https://github.com/zcash/librustzcash" license = "MIT OR Apache-2.0" edition = "2018" +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [dependencies] blake2b_simd = { version = "0.5", default-features = false } byteorder = { version = "1", default-features = false } diff --git a/src/lib.rs b/src/lib.rs index 646d0ee..f973329 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,6 +4,7 @@ //! protocols. #![no_std] +#![cfg_attr(docsrs, feature(doc_cfg))] // Catch documentation errors caused by code changes. #![deny(broken_intra_doc_links)] #![deny(unsafe_code)] @@ -29,6 +30,7 @@ use rand_core::RngCore; use subtle::{Choice, ConstantTimeEq}; #[cfg(feature = "alloc")] +#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))] pub mod batch; pub const COMPACT_NOTE_SIZE: usize = 1 + // version @@ -175,6 +177,7 @@ pub trait Domain { } #[cfg(feature = "alloc")] +#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))] pub trait BatchDomain: Domain { /// Computes `Self::kdf` on a batch of items. ///