about summary refs log tree commit diff
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
parentffa97a647e3786add894093aa2cc7561c7c64607 (diff)
downloadrust-608297247a776a32c4aca08f1784caca8a3c33e8.tar.gz
rust-608297247a776a32c4aca08f1784caca8a3c33e8.zip
Remove `std_detect` from stdarch examples
-rw-r--r--library/stdarch/Cargo.lock23
-rw-r--r--library/stdarch/examples/Cargo.toml1
-rw-r--r--library/stdarch/examples/connect5.rs16
-rw-r--r--library/stdarch/examples/hex.rs8
4 files changed, 18 insertions, 30 deletions
diff --git a/library/stdarch/Cargo.lock b/library/stdarch/Cargo.lock
index 4806682e6e0..21ce304db0d 100644
--- a/library/stdarch/Cargo.lock
+++ b/library/stdarch/Cargo.lock
@@ -581,18 +581,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f"
 
 [[package]]
-name = "rustc-std-workspace-alloc"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f9d441c3b2ebf55cebf796bfdc265d67fa09db17b7bb6bd4be75c509e1e8fec3"
-
-[[package]]
-name = "rustc-std-workspace-core"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa9c45b374136f52f2d6311062c7146bff20fec063c3f5d46a410bd937746955"
-
-[[package]]
 name = "ryu"
 version = "1.0.20"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -695,16 +683,6 @@ dependencies = [
 ]
 
 [[package]]
-name = "std_detect"
-version = "0.1.5"
-dependencies = [
- "cfg-if",
- "libc",
- "rustc-std-workspace-alloc",
- "rustc-std-workspace-core",
-]
-
-[[package]]
 name = "stdarch-gen-arm"
 version = "0.1.0"
 dependencies = [
@@ -756,7 +734,6 @@ dependencies = [
  "core_arch",
  "quickcheck",
  "rand",
- "std_detect",
 ]
 
 [[package]]
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();