From 4fc3a6c143210bb2911c1e2015f3cd1c8955a443 Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Sat, 28 Oct 2023 02:34:08 +0100 Subject: [PATCH] Attempt to fix cpu-detection test --- crates/std_detect/tests/cpu-detection.rs | 17 ++++------------- examples/connect5.rs | 4 +++- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/crates/std_detect/tests/cpu-detection.rs b/crates/std_detect/tests/cpu-detection.rs index f20ea6a2f7..6c63e5bd9c 100644 --- a/crates/std_detect/tests/cpu-detection.rs +++ b/crates/std_detect/tests/cpu-detection.rs @@ -1,17 +1,8 @@ -#![feature( - stdarch_internal, - stdarch_arm_feature_detection, - stdarch_powerpc_feature_detection -)] +#![feature(stdarch_internal)] +#![cfg_attr(target_arch = "arm", feature(stdarch_arm_feature_detection))] +#![cfg_attr(target_arch = "powerpc", feature(stdarch_powerpc_feature_detection))] +#![cfg_attr(target_arch = "powerpc64", feature(stdarch_powerpc_feature_detection))] #![allow(clippy::unwrap_used, clippy::use_debug, clippy::print_stdout)] -#![cfg(any( - target_arch = "arm", - target_arch = "aarch64", - target_arch = "x86", - target_arch = "x86_64", - target_arch = "powerpc", - target_arch = "powerpc64" -))] #[macro_use] extern crate std_detect; diff --git a/examples/connect5.rs b/examples/connect5.rs index 6298255421..ffbff5e486 100644 --- a/examples/connect5.rs +++ b/examples/connect5.rs @@ -28,7 +28,9 @@ //! You should see a game self-playing. In the end of the game, it shows the average time for //! each move. -#![feature(avx512_target_feature, stdarch_x86_avx512)] +#![feature(avx512_target_feature)] +#![cfg_attr(target_arch = "x86", feature(stdarch_x86_avx512))] +#![cfg_attr(target_arch = "x86_64", feature(stdarch_x86_avx512))] #![feature(stmt_expr_attributes)] use rand::seq::SliceRandom;