2019-01-21 16:59:10 +01:00
|
|
|
//! Run-time feature detection for the Rust standard library.
|
|
|
|
|
//!
|
|
|
|
|
//! To detect whether a feature is enabled in the system running the binary
|
|
|
|
|
//! use one of the appropriate macro for the target:
|
|
|
|
|
//!
|
|
|
|
|
//! * `x86` and `x86_64`: [`is_x86_feature_detected`]
|
|
|
|
|
//! * `arm`: [`is_arm_feature_detected`]
|
|
|
|
|
//! * `aarch64`: [`is_aarch64_feature_detected`]
|
2021-12-08 19:41:12 +08:00
|
|
|
//! * `riscv`: [`is_riscv_feature_detected`]
|
2019-01-21 16:59:10 +01:00
|
|
|
//! * `mips`: [`is_mips_feature_detected`]
|
|
|
|
|
//! * `mips64`: [`is_mips64_feature_detected`]
|
|
|
|
|
//! * `powerpc`: [`is_powerpc_feature_detected`]
|
|
|
|
|
//! * `powerpc64`: [`is_powerpc64_feature_detected`]
|
2023-10-25 15:09:45 +08:00
|
|
|
//! * `loongarch`: [`is_loongarch_feature_detected`]
|
2025-01-12 17:35:47 +01:00
|
|
|
//! * `s390x`: [`is_s390x_feature_detected`]
|
2019-01-21 16:59:10 +01:00
|
|
|
|
2024-01-04 14:35:45 +00:00
|
|
|
#![unstable(feature = "stdarch_internal", issue = "none")]
|
2023-05-04 12:01:06 +01:00
|
|
|
#![feature(staged_api, doc_cfg, allow_internal_unstable)]
|
2021-04-07 00:46:39 -04:00
|
|
|
#![deny(rust_2018_idioms)]
|
2019-04-16 10:50:30 +02:00
|
|
|
#![allow(clippy::shadow_reuse)]
|
2019-02-13 22:05:49 +01:00
|
|
|
#![cfg_attr(test, allow(unused_imports))]
|
2019-01-21 16:59:10 +01:00
|
|
|
#![no_std]
|
2023-03-09 21:02:29 +00:00
|
|
|
#![allow(internal_features)]
|
2019-01-21 16:59:10 +01:00
|
|
|
|
2021-02-14 22:14:37 +00:00
|
|
|
#[cfg(test)]
|
|
|
|
|
#[macro_use]
|
|
|
|
|
extern crate std;
|
2019-02-07 22:56:23 +01:00
|
|
|
|
2022-01-24 01:32:45 +00:00
|
|
|
// rust-lang/rust#83888: removing `extern crate` gives an error that `vec_spare>
|
|
|
|
|
#[cfg_attr(feature = "std_detect_file_io", allow(unused_extern_crates))]
|
|
|
|
|
#[cfg(feature = "std_detect_file_io")]
|
|
|
|
|
extern crate alloc;
|
|
|
|
|
|
2019-01-21 16:59:10 +01:00
|
|
|
#[doc(hidden)]
|
2024-01-04 14:35:45 +00:00
|
|
|
#[unstable(feature = "stdarch_internal", issue = "none")]
|
2019-01-21 16:59:10 +01:00
|
|
|
pub mod detect;
|