Skip to content

Commit 35e78b2

Browse files
authored
Enable unexpected cfgs lint (#656)
Previously, the only way to configure this lint was using a build.rs file, but now it can be done using Cargo.toml as well.
1 parent 921bd7c commit 35e78b2

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

curve25519-dalek/Cargo.toml

+10
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,13 @@ group-bits = ["group", "ff/bits"]
7171

7272
[target.'cfg(all(not(curve25519_dalek_backend = "fiat"), not(curve25519_dalek_backend = "serial"), target_arch = "x86_64"))'.dependencies]
7373
curve25519-dalek-derive = { version = "0.1", path = "../curve25519-dalek-derive" }
74+
75+
[lints.rust.unexpected_cfgs]
76+
level = "warn"
77+
check-cfg = [
78+
'cfg(allow_unused_unsafe)',
79+
'cfg(curve25519_dalek_backend, values("fiat", "serial", "simd"))',
80+
'cfg(curve25519_dalek_diagnostics, values("build"))',
81+
'cfg(curve25519_dalek_bits, values("32", "64"))',
82+
'cfg(nightly)',
83+
]

curve25519-dalek/src/backend/vector/ifma/edwards.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ impl<'a> From<&'a edwards::EdwardsPoint> for NafLookupTable8<CachedPoint> {
249249
}
250250
}
251251

252-
#[cfg(target_feature = "avx512ifma,avx512vl")]
252+
#[cfg(all(target_feature = "avx512ifma", target_feature = "avx512vl"))]
253253
#[cfg(test)]
254254
mod test {
255255
use super::*;

curve25519-dalek/src/backend/vector/ifma/field.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ impl<'a, 'b> Mul<&'b F51x4Reduced> for &'a F51x4Reduced {
629629
}
630630
}
631631

632-
#[cfg(target_feature = "avx512ifma,avx512vl")]
632+
#[cfg(all(target_feature = "avx512ifma", target_feature = "avx512vl"))]
633633
#[cfg(test)]
634634
mod test {
635635
use super::*;

curve25519-dalek/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@
4242
unused_lifetimes,
4343
unused_qualifications
4444
)]
45-
// Requires MSRV 1.77 as it does not allow build.rs gating
46-
#![allow(unexpected_cfgs)]
4745

4846
//------------------------------------------------------------------------
4947
// External dependencies:

0 commit comments

Comments
 (0)