Description
Related to #141863. I'd like to implement a reliable //@ needs-target-std
compiletest directive, but after some experimentation I found out that we don't really have a reliable way to determine if a given target tuple supports std.
Bootstrap, for this reason, has to resort to the hack for determining target std support that is
rust/src/bootstrap/src/core/config/toml/target.rs
Lines 87 to 89 in 100199c
Noratrieb suggested a proper long-term solution (on community discord)
the std build script should probably read it from the metadata field [..]
and then the metadata is actually reliable
which seems way more principled to me.
rustc
similarly does not have any way to convey this information. For instance, the closest thing is the target spec metadata.std
field, but not all built-in target specs actually populate this field1. Built-in target specs currently without std support field (2025-06-10)2:
aarch64-unknown-redox
aarch64-unknown-teeos
aarch64-unknown-uefi
aarch64-uwp-windows-msvc
arm64ec-pc-windows-msvc
armv6k-nintendo-3ds
armv7-wrs-vxworks-eabihf
avr-none
i586-unknown-redox
i686-unknown-uefi
i686-uwp-windows-gnu
i686-uwp-windows-msvc
mips-mti-none-elf
mipsel-mti-none-elf
powerpc-wrs-vxworks-spe
powerpc64-ibm-aix
riscv32im-risc0-zkvm-elf
riscv32imac-unknown-xous-elf
thumbv7a-pc-windows-msvc
wasm32-wali-linux-musl
wasm64-unknown-unknown
x86_64-unknown-l4re-uclibc
x86_64-unknown-uefi
xtensa-esp32-espidf
xtensa-esp32s2-espidf
xtensa-esp32s3-espidf