Skip to content

Add more example target_arch values#2279

Open
patchunwrap wants to merge 1 commit into
rust-lang:masterfrom
patchunwrap:add_more_target_arch_values
Open

Add more example target_arch values#2279
patchunwrap wants to merge 1 commit into
rust-lang:masterfrom
patchunwrap:add_more_target_arch_values

Conversation

@patchunwrap
Copy link
Copy Markdown

These have been collected from
https://doc.rust-lang.org/stable/core/arch/index.html

Since mips was already on the list I figured I would add all target arch options have been added (even ones not available on stable Rust) and add a note to help the reader have the right expectations.

I found this when trying to figure out what the target_arch for riscv would be. I guess I kinda assumed it would be riscv64gc. If there is a different authoritative document somewhere, maybe this should link to that instead. But I figured the reference was that authoritative document.

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.
@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Jun 4, 2026
@folkertdev
Copy link
Copy Markdown
Contributor

That is not even the full list, rust will print the full list when you do give it something it doesn't recognize

warning: unexpected `cfg` condition value: `x85`
 --> src/lib.rs:2:7
  |
2 | #[cfg(target_arch = "x85")]
  |       ^^^^^^^^^^^^^^-----
  |                     |
  |                     help: there is a expected value with a similar name: `"x86"`
  |
  = note: expected values for `target_arch` are: `aarch64`, `amdgpu`, `arm`, `arm64ec`, `avr`, `bpf`, `csky`, `hexagon`, `loongarch32`, `loongarch64`, `m68k`, `mips`, `mips32r6`, `mips64`, `mips64r6`, `msp430`, `nvptx64`, `powerpc`, `powerpc64`, `riscv32`, `riscv64`, `s390x`, `sparc`, `sparc64`, `wasm32`, `wasm64`, `x86`, `x86_64`, and `xtensa`
  = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
  = note: `#[warn(unexpected_cfgs)]` on by default

I'm not sure that the reference is the right place for this though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: The marked PR is awaiting review from a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants