diff --git a/crates/std_detect/tests/cpu-detection.rs b/crates/std_detect/tests/cpu-detection.rs index f20ea6a2f7..8d551fc2cb 100644 --- a/crates/std_detect/tests/cpu-detection.rs +++ b/crates/std_detect/tests/cpu-detection.rs @@ -1,19 +1,20 @@ -#![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] +#[cfg_attr( + 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; #[test] diff --git a/crates/std_detect/tests/macro_trailing_commas.rs b/crates/std_detect/tests/macro_trailing_commas.rs index 3d5c736a05..8304b225f5 100644 --- a/crates/std_detect/tests/macro_trailing_commas.rs +++ b/crates/std_detect/tests/macro_trailing_commas.rs @@ -1,4 +1,6 @@ -#![feature(stdarch_arm_feature_detection, stdarch_powerpc_feature_detection)] +#![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( 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;