Skip to main content

std_detect/
lib.rs

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//! * `powerpc`: [`is_powerpc_feature_detected`]
12//! * `loongarch`: [`is_loongarch_feature_detected`]
13//! * `s390x`: [`is_s390x_feature_detected`]
14
15#![unstable(feature = "stdarch_internal", issue = "none")]
16#![feature(staged_api, doc_cfg, allow_internal_unstable)]
17#![deny(rust_2018_idioms)]
18#![allow(clippy::shadow_reuse)]
19#![cfg_attr(test, allow(unused_imports))]
20#![no_std]
21#![allow(internal_features)]
22
23#[cfg(test)]
24#[macro_use]
25extern crate std;
26
27// rust-lang/rust#83888: removing `extern crate` gives an error that `vec_spare>
28#[allow(unused_extern_crates)]
29extern crate alloc;
30
31#[doc(hidden)]
32#[unstable(feature = "stdarch_internal", issue = "none")]
33pub mod detect;