about summary refs log tree commit diff
path: root/library/stdarch/examples
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2025-07-13 13:08:17 +0200
committerJakub Beránek <berykubik@gmail.com>2025-07-22 20:22:16 +0200
commit608297247a776a32c4aca08f1784caca8a3c33e8 (patch)
tree6a1798428355a65b0ec3d47954e1f006f2013d95 /library/stdarch/examples
parentffa97a647e3786add894093aa2cc7561c7c64607 (diff)
downloadrust-608297247a776a32c4aca08f1784caca8a3c33e8.tar.gz
rust-608297247a776a32c4aca08f1784caca8a3c33e8.zip
Remove `std_detect` from stdarch examples
Diffstat (limited to 'library/stdarch/examples')
-rw-r--r--library/stdarch/examples/Cargo.toml1
-rw-r--r--library/stdarch/examples/connect5.rs16
-rw-r--r--library/stdarch/examples/hex.rs8
3 files changed, 18 insertions, 7 deletions
diff --git a/library/stdarch/examples/Cargo.toml b/library/stdarch/examples/Cargo.toml
index 61184494e15..61451edee84 100644
--- a/library/stdarch/examples/Cargo.toml
+++ b/library/stdarch/examples/Cargo.toml
@@ -12,7 +12,6 @@ default-run = "hex"
 
 [dependencies]
 core_arch = { path = "../crates/core_arch" }
-std_detect = { path = "../crates/std_detect" }
 quickcheck = "1.0"
 rand = "0.8"
 
diff --git a/library/stdarch/examples/connect5.rs b/library/stdarch/examples/connect5.rs
index 1d8e0f0990a..371b28552b3 100644
--- a/library/stdarch/examples/connect5.rs
+++ b/library/stdarch/examples/connect5.rs
@@ -40,9 +40,13 @@ use std::cmp;
 use std::time::Instant;
 
 #[cfg(target_arch = "x86")]
-use {core_arch::arch::x86::*, std_detect::is_x86_feature_detected};
+use core_arch::arch::x86::*;
 #[cfg(target_arch = "x86_64")]
-use {core_arch::arch::x86_64::*, std_detect::is_x86_feature_detected};
+use core_arch::arch::x86_64::*;
+#[cfg(target_arch = "x86")]
+use std::is_x86_feature_detected;
+#[cfg(target_arch = "x86_64")]
+use std::is_x86_feature_detected;
 
 // types
 
@@ -558,8 +562,12 @@ fn search(pos: &Pos, alpha: i32, beta: i32, depth: i32, _ply: i32) -> i32 {
     assert_ne!(bm, MOVE_NONE);
     assert!(bs >= -EVAL_INF && bs <= EVAL_INF);
 
-    // best move at the root node, best score elsewhere
-    if _ply == 0 { bm } else { bs }
+    //best move at the root node, best score elsewhere
+    if _ply == 0 {
+        bm
+    } else {
+        bs
+    }
 }
 
 /// Evaluation function: give different scores to different patterns after a fixed depth.
diff --git a/library/stdarch/examples/hex.rs b/library/stdarch/examples/hex.rs
index e393ad72716..95ffbaf666c 100644
--- a/library/stdarch/examples/hex.rs
+++ b/library/stdarch/examples/hex.rs
@@ -36,9 +36,13 @@ use std::{
 };
 
 #[cfg(target_arch = "x86")]
-use {core_arch::arch::x86::*, std_detect::is_x86_feature_detected};
+use core_arch::arch::x86::*;
 #[cfg(target_arch = "x86_64")]
-use {core_arch::arch::x86_64::*, std_detect::is_x86_feature_detected};
+use core_arch::arch::x86_64::*;
+#[cfg(target_arch = "x86")]
+use std::is_x86_feature_detected;
+#[cfg(target_arch = "x86_64")]
+use std::is_x86_feature_detected;
 
 fn main() {
     let mut input = Vec::new();