1//! Run-time feature detection for the Rust standard library.
2//!
3//! To detect whether a feature is enabled in the system running the binary
4//! use one of the appropriate macro for the target:
5//!
6//! * `x86` and `x86_64`: [`is_x86_feature_detected`]
7//! * `arm`: [`is_arm_feature_detected`]
8//! * `aarch64`: [`is_aarch64_feature_detected`]
9//! * `riscv`: [`is_riscv_feature_detected`]
10//! * `mips`: [`is_mips_feature_detected`]
11//! * `mips64`: [`is_mips64_feature_detected`]
12//! * `powerpc`: [`is_powerpc_feature_detected`]
13//! * `powerpc64`: [`is_powerpc64_feature_detected`]
14//! * `loongarch`: [`is_loongarch_feature_detected`]
15
16#![unstable(feature = "stdarch_internal", issue = "none")]
17#![feature(staged_api, doc_cfg, allow_internal_unstable)]
18#![deny(rust_2018_idioms)]
19#![allow(clippy::shadow_reuse)]
20#![cfg_attr(test, allow(unused_imports))]
21#![no_std]
22#![allow(internal_features)]
23#![cfg_attr(
24 any(target_arch = "x86", target_arch = "x86_64"),
25 feature(stdarch_x86_has_cpuid)
26)]
27
28#[cfg(test)]
29#[macro_use]
30extern crate std;
31
32// rust-lang/rust#83888: removing `extern crate` gives an error that `vec_spare>
33#[cfg_attr(feature = "std_detect_file_io", allow(unused_extern_crates))]
34#[cfg(feature = "std_detect_file_io")]
35extern crate alloc;
36
37#[doc(hidden)]
38#[unstable(feature = "stdarch_internal", issue = "none")]
39pub mod detect;
40