Fix curve25519-dalek-derive test compilation on CentOS 10 x86_64 (#756)

The test assumed that the 'avx2' target_feature would never be set
and used this fact to verify that unsafe_target_feature would
correctly not even compile test functions maked with that
target_feature. As of CentOS 10 and derivatives, th avx2
target_feature is now set by the system rustc, so let's use a
target_feature less likely to appear in the real world.

Closes #755
This commit is contained in:
Noa Resare 2025-05-26 15:24:17 +01:00 committed by GitHub
parent 67625763c1
commit e3b5328202
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -122,10 +122,15 @@ mod inner_spec {
#[test]
fn test_sse2_only() {}
#[unsafe_target_feature("avx2")]
// it turns out that for compilation to succeed, the feature needs be supported by rustc. For this
// test actually verify what happens when the target_feature is not enabled, this needs to be a
// pretty esoteric feature. Looking at the table of supported avx512 features at
// https://en.wikipedia.org/wiki/AVX-512#CPUs_with_AVX-512 it seems avx512vp2intersect is one of the
// most unusual ones that has rustc knows about
#[unsafe_target_feature("avx512vp2intersect")]
#[test]
fn test_avx2_only() {
compile_error!();
fn test_unset_target_feature() {
compile_error!("When an unknown target_feature is set on a test, unsafe_target_feature is expected remove the function");
}
#[test]