From 385a9f943f50e4a2c3cb3753cd93a2624c1b99f7 Mon Sep 17 00:00:00 2001 From: "Sergey \"Shnatsel\" Davidoff" Date: Wed, 17 Jul 2024 06:40:11 +0100 Subject: [PATCH 1/6] Make required cfg show up on docs.rs --- src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 8f03b6d..5ca777f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -90,8 +90,10 @@ macro_rules! impl_fft_interleaved_for { }; } +#[cfg_attr(docs_rs, doc(cfg(feature = "complex-nums")))] #[cfg(feature = "complex-nums")] impl_fft_interleaved_for!(fft_32_interleaved, f32, fft_32, deinterleave_complex32); +#[cfg_attr(docs_rs, doc(cfg(feature = "complex-nums")))] #[cfg(feature = "complex-nums")] impl_fft_interleaved_for!(fft_64_interleaved, f64, fft_64, deinterleave_complex64); From 0a20be530ee392a51e22970db703a44568756d62 Mon Sep 17 00:00:00 2001 From: "Sergey \"Shnatsel\" Davidoff" Date: Wed, 17 Jul 2024 06:43:42 +0100 Subject: [PATCH 2/6] Fix docsrs config according to Clippy tbh not sure if Clippy is right in this case --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 5ca777f..13927e2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -90,10 +90,10 @@ macro_rules! impl_fft_interleaved_for { }; } -#[cfg_attr(docs_rs, doc(cfg(feature = "complex-nums")))] +#[cfg_attr(ddocsrs, doc(cfg(feature = "complex-nums")))] #[cfg(feature = "complex-nums")] impl_fft_interleaved_for!(fft_32_interleaved, f32, fft_32, deinterleave_complex32); -#[cfg_attr(docs_rs, doc(cfg(feature = "complex-nums")))] +#[cfg_attr(docsrs, doc(cfg(feature = "complex-nums")))] #[cfg(feature = "complex-nums")] impl_fft_interleaved_for!(fft_64_interleaved, f64, fft_64, deinterleave_complex64); From 35f290020448015a697e9cffecbe164c84f26391 Mon Sep 17 00:00:00 2001 From: "Sergey \"Shnatsel\" Davidoff" Date: Wed, 17 Jul 2024 06:44:47 +0100 Subject: [PATCH 3/6] Make docs.rs build docs with all features enabled --- Cargo.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index bd19297..93656f0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,9 @@ keywords = ["quantum", "fft", "discrete", "fourier", "transform"] categories = ["algorithms", "compression", "science"] exclude = ["assets", "scripts", "benches"] +[package.metadata.docs.rs] +all-features = true + [dependencies] num-traits = "0.2.18" multiversion = "0.7" @@ -40,4 +43,4 @@ inherits = "release" debug = true [package.metadata.docs.rs] -all-features = true \ No newline at end of file +all-features = true From 379f0313d305b5e62f030bc2d04c39b6ac552df4 Mon Sep 17 00:00:00 2001 From: "Sergey \"Shnatsel\" Davidoff" Date: Wed, 17 Jul 2024 06:47:19 +0100 Subject: [PATCH 4/6] Don't gate feature documentation on docs.rs, we're on nightly anyway --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 13927e2..3373ab4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -90,10 +90,10 @@ macro_rules! impl_fft_interleaved_for { }; } -#[cfg_attr(ddocsrs, doc(cfg(feature = "complex-nums")))] +#[doc(cfg(feature = "complex-nums"))] #[cfg(feature = "complex-nums")] impl_fft_interleaved_for!(fft_32_interleaved, f32, fft_32, deinterleave_complex32); -#[cfg_attr(docsrs, doc(cfg(feature = "complex-nums")))] +#[doc(cfg(feature = "complex-nums"))] #[cfg(feature = "complex-nums")] impl_fft_interleaved_for!(fft_64_interleaved, f64, fft_64, deinterleave_complex64); From f347927e347cae043f7f7d5650d9078be1866297 Mon Sep 17 00:00:00 2001 From: "Sergey \"Shnatsel\" Davidoff" Date: Wed, 17 Jul 2024 06:51:09 +0100 Subject: [PATCH 5/6] Undo duplicate docs.rs all-features --- Cargo.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 93656f0..b64fb50 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,9 +10,6 @@ keywords = ["quantum", "fft", "discrete", "fourier", "transform"] categories = ["algorithms", "compression", "science"] exclude = ["assets", "scripts", "benches"] -[package.metadata.docs.rs] -all-features = true - [dependencies] num-traits = "0.2.18" multiversion = "0.7" From a0c5fc9fae2bfb472bb6b1f34ff960ae16841ac5 Mon Sep 17 00:00:00 2001 From: "Sergey \"Shnatsel\" Davidoff" Date: Wed, 17 Jul 2024 06:57:18 +0100 Subject: [PATCH 6/6] Add #![feature(doc_cfg)] to make rustdoc actually accept doc_cfg --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index 3373ab4..09f64a1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,6 +9,7 @@ )] #![forbid(unsafe_code)] #![feature(portable_simd, avx512_target_feature)] +#![feature(doc_cfg)] #[cfg(feature = "complex-nums")] use crate::utils::{combine_re_im, deinterleave_complex32, deinterleave_complex64};