From c819a9f6c68cbd5ea3576162a6b94db257823728 Mon Sep 17 00:00:00 2001 From: patchunwrap <251685895+patchunwrap@users.noreply.github.com> Date: Thu, 4 Jun 2026 20:26:37 +1000 Subject: [PATCH] Add more example target_arch values These have been collected from https://doc.rust-lang.org/stable/core/arch/index.html Since mips was already on the list all target arch options have been added (even ones not available on stable Rust). A note has been added to inform the reader about target_arch availability. --- src/conditional-compilation.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/conditional-compilation.md b/src/conditional-compilation.md index 67179eced2..c5375d2fbd 100644 --- a/src/conditional-compilation.md +++ b/src/conditional-compilation.md @@ -97,15 +97,25 @@ r[cfg.target_arch.def] Key-value option set once with the target's CPU architecture. The value is similar to the first element of the platform's target triple, but not identical. r[cfg.target_arch.values] -Example values: +Example values (Note that not all of these are available on stable rust): * `"x86"` * `"x86_64"` +* `"arm"` +* `"aarch64"` +* `"amdgpu"` +* `"hexagon"` +* `"riscv32"` +* `"riscv64"` * `"mips"` * `"powerpc"` * `"powerpc64"` -* `"arm"` -* `"aarch64"` +* `"nvptx"` +* `"wasm"` +* `"loongarch32"` +* `"loongarch64"` +* `"s390x"` + r[cfg.target_feature] ### `target_feature`