🔬This is a nightly-only experimental API. (
stdarch_internal)Expand description
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:
x86andx86_64:is_x86_feature_detectedarm:is_arm_feature_detectedaarch64:is_aarch64_feature_detectedriscv:is_riscv_feature_detectedmips:is_mips_feature_detectedmips64:is_mips64_feature_detectedpowerpc:is_powerpc_feature_detectedpowerpc64:is_powerpc64_feature_detectedloongarch:is_loongarch_feature_detecteds390x:is_s390x_feature_detected
Macros§
- detect_
feature Experimental - is_
aarch64_ feature_ detected Experimental AArch64 or target_arch="arm64ec" - This macro tests, at runtime, whether an
aarch64feature is enabled on aarch64 platforms. Currently most features are only supported on linux-based platforms. - is_
arm_ feature_ detected Experimental ARM - Checks if
armfeature is enabled. - is_
loongarch_ feature_ detected Experimental LoongArch LA32 or LoongArch LA64 - Checks if
loongarchfeature is enabled. Supported arguments are: - is_
mips64_ feature_ detected Experimental MIPS-64 - Checks if
mips64feature is enabled. - is_
mips_ feature_ detected Experimental MIPS - Checks if
mipsfeature is enabled. - is_
powerpc64_ feature_ detected Experimental PowerPC-64 - Checks if
powerpcfeature is enabled. - is_
powerpc_ feature_ detected Experimental PowerPC - Checks if
powerpcfeature is enabled. - is_
riscv_ feature_ detected Experimental RISC-V RV32 or RISC-V RV64 - A macro to test at runtime whether instruction sets are available on RISC-V platforms.
- is_
s390x_ feature_ detected Experimental s390x - Checks if
s390xfeature is enabled. - is_
x86_ feature_ detected Experimental x86 or x86-64 - A macro to test at runtime whether a CPU feature is available on x86/x86-64 platforms.