about summary refs log tree commit diff
path: root/library/stdarch/crates/std_detect
diff options
context:
space:
mode:
authorJubilee Young <workingjubilee@gmail.com>2024-06-24 17:01:19 -0700
committerAmanieu d'Antras <amanieu@gmail.com>2024-06-29 19:38:42 +0200
commit8b77e779cbabd67733f3cda9c18aea1661608a32 (patch)
tree8aab1e529eca6d7424f04c643793ae5dd7d3331a /library/stdarch/crates/std_detect
parentd7ea407a287ffd4f3cf4b9255099957942cae61a (diff)
downloadrust-8b77e779cbabd67733f3cda9c18aea1661608a32.tar.gz
rust-8b77e779cbabd67733f3cda9c18aea1661608a32.zip
Remove `has_cpuid`
Diffstat (limited to 'library/stdarch/crates/std_detect')
-rw-r--r--library/stdarch/crates/std_detect/src/detect/os/x86.rs5
-rw-r--r--library/stdarch/crates/std_detect/src/lib.rs4
2 files changed, 2 insertions, 7 deletions
diff --git a/library/stdarch/crates/std_detect/src/detect/os/x86.rs b/library/stdarch/crates/std_detect/src/detect/os/x86.rs
index 027df571f82..f8811e8cf13 100644
--- a/library/stdarch/crates/std_detect/src/detect/os/x86.rs
+++ b/library/stdarch/crates/std_detect/src/detect/os/x86.rs
@@ -28,9 +28,8 @@ use crate::detect::{bit, cache, Feature};
 pub(crate) fn detect_features() -> cache::Initializer {
     let mut value = cache::Initializer::default();
 
-    // If the x86 CPU does not support the CPUID instruction then it is too
-    // old to support any of the currently-detectable features.
-    if !has_cpuid() {
+    if cfg!(target_env = "sgx") {
+        // doesn't support this because it is untrusted data
         return value;
     }
 
diff --git a/library/stdarch/crates/std_detect/src/lib.rs b/library/stdarch/crates/std_detect/src/lib.rs
index 846b17b01d5..881e12cf9c3 100644
--- a/library/stdarch/crates/std_detect/src/lib.rs
+++ b/library/stdarch/crates/std_detect/src/lib.rs
@@ -20,10 +20,6 @@
 #![cfg_attr(test, allow(unused_imports))]
 #![no_std]
 #![allow(internal_features)]
-#![cfg_attr(
-    any(target_arch = "x86", target_arch = "x86_64"),
-    feature(stdarch_x86_has_cpuid)
-)]
 
 #[cfg(test)]
 #[macro_use]