Skip to content

Commit

Permalink
Mitigate check-cfg until MSRV 1.77 (dalek-cryptography#652)
Browse files Browse the repository at this point in the history
  • Loading branch information
pinkforest authored May 9, 2024
1 parent 1efe6a9 commit 9252fa5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
9 changes: 1 addition & 8 deletions curve25519-dalek-derive/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ where
a - b
}

#[unsafe_target_feature("sse2")]
#[cfg(feature = "dummy")]
fn function_with_cfg() {}

#[unsafe_target_feature("sse2")]
#[rustfmt::skip]
fn function_with_rustfmt_skip() {}
Expand All @@ -45,9 +41,6 @@ impl Struct {
fn member_function_with_const_arg<const N: u32>(self) -> u32 {
self.a - N
}

#[cfg(feature = "dummy")]
fn member_function_with_cfg() {}
}

struct StructWithGenerics<T>
Expand Down Expand Up @@ -93,7 +86,7 @@ mod inner {
}
}

#[unsafe_target_feature_specialize("sse2", "avx2", conditional("avx512ifma", disabled))]
#[unsafe_target_feature_specialize("sse2", "avx2")]
mod inner_spec {
#[for_target_feature("sse2")]
const CONST: u32 = 1;
Expand Down
2 changes: 2 additions & 0 deletions curve25519-dalek/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
unused_lifetimes,
unused_qualifications
)]
// Requires MSRV 1.77 as it does not allow build.rs gating
#![allow(unexpected_cfgs)]

//------------------------------------------------------------------------
// External dependencies:
Expand Down
2 changes: 2 additions & 0 deletions curve25519-dalek/src/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1233,10 +1233,12 @@ impl Field for Scalar {
}

fn sqrt_ratio(num: &Self, div: &Self) -> (Choice, Self) {
#[allow(unused_qualifications)]
group::ff::helpers::sqrt_ratio_generic(num, div)
}

fn sqrt(&self) -> CtOption<Self> {
#[allow(unused_qualifications)]
group::ff::helpers::sqrt_tonelli_shanks(
self,
[
Expand Down
1 change: 0 additions & 1 deletion x25519-dalek/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
// README.md as the crate documentation.

#![no_std]
#![cfg_attr(feature = "bench", feature(test))]
#![cfg_attr(docsrs, feature(doc_auto_cfg, doc_cfg, doc_cfg_hide))]
#![cfg_attr(docsrs, doc(cfg_hide(docsrs)))]
#![deny(missing_docs)]
Expand Down

0 comments on commit 9252fa5

Please sign in to comment.