diff --git a/Cargo.toml b/Cargo.toml index 9125f23..fcc6171 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,6 +43,7 @@ experimental_write_impl = [] [package.metadata.docs.rs] all-features = true +rustdoc-args = ["--cfg","docs_rs"] [profile.test] opt-level = 3 diff --git a/src/tinyvec.rs b/src/tinyvec.rs index 49c3786..f57d69d 100644 --- a/src/tinyvec.rs +++ b/src/tinyvec.rs @@ -26,6 +26,7 @@ use alloc::vec::{self, Vec}; /// let many_ints: TinyVec<[i32; 4]> = tiny_vec!(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); /// ``` #[macro_export] +#[cfg_attr(docs_rs, doc(cfg(feature = "alloc")))] macro_rules! tiny_vec { ($array_type:ty => $($elem:expr),* $(,)?) => { { @@ -82,6 +83,7 @@ pub enum TinyVecConstructor { /// let some_ints = tiny_vec!([i32; 4] => 1, 2, 3); /// ``` #[derive(Clone)] +#[cfg_attr(docs_rs, doc(cfg(feature = "alloc")))] pub enum TinyVec { #[allow(missing_docs)] Inline(ArrayVec),