From b8c62ec4b44e691fe8fd3987f60b1a26a8e62761 Mon Sep 17 00:00:00 2001 From: Henry de Valence Date: Fri, 15 Feb 2019 11:18:25 -0800 Subject: [PATCH] Attempt to fix cfg(rustdoc) on docs.rs Building the docs currently doesn't work, because rustdoc enables parts of the code (to document them) which then don't check (because there are missing exports or dependencies). This **should** fix the issue, but there's no way to test without publishing a new version. --- Cargo.toml | 2 +- src/backend/vector/mod.rs | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1a16652..d944f3a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ build = "build.rs" [package.metadata.docs.rs] rustdoc-args = ["--html-in-header", ".cargo/registry/src/github.com-1ecc6299db9ec823/curve25519-dalek-0.13.2/rustdoc-include-katex-header.html"] -features = ["nightly"] +features = ["nightly", "simd_backend"] [badges] travis-ci = { repository = "dalek-cryptography/curve25519-dalek", branch = "master"} diff --git a/src/backend/vector/mod.rs b/src/backend/vector/mod.rs index d034e6c..76d36ab 100644 --- a/src/backend/vector/mod.rs +++ b/src/backend/vector/mod.rs @@ -22,13 +22,19 @@ doc(include = "../docs/parallel-formulas.md") )] -#[cfg(not(any(target_feature = "avx2", target_feature = "avx512ifma",)))] +#[cfg(not(any(target_feature = "avx2", target_feature = "avx512ifma", rustdoc)))] compile_error!("simd_backend selected without target_feature=+avx2 or +avx512ifma"); -#[cfg(any(all(target_feature = "avx2", not(target_feature = "avx512ifma")), rustdoc))] +#[cfg(any( + all(target_feature = "avx2", not(target_feature = "avx512ifma")), + rustdoc +))] #[doc(cfg(all(target_feature = "avx2", not(target_feature = "avx512ifma"))))] pub mod avx2; -#[cfg(all(target_feature = "avx2", not(target_feature = "avx512ifma")))] +#[cfg(any( + all(target_feature = "avx2", not(target_feature = "avx512ifma")), + rustdoc +))] pub(crate) use self::avx2::{ constants::BASEPOINT_ODD_LOOKUP_TABLE, edwards::CachedPoint, edwards::ExtendedPoint, };