rust-lang/rust · error
Unsupported target {}
Error message
Unsupported target {} What it means
The intrinsic-test harness (library/stdarch/crates/intrinsic-test/src/main.rs) only knows how to generate and run intrinsic tests for arm/aarch64 and x86 targets. main() matches the target prefix and panics with unimplemented!("Unsupported target {}") for anything else.
Source
Thrown at library/stdarch/crates/intrinsic-test/src/main.rs:25
use arm::Arm;
use common::SupportedArchitecture;
use common::cli::{Cli, ProcessedCli};
use x86::X86;
fn main() {
pretty_env_logger::init();
let args: Cli = clap::Parser::parse();
let processed_cli_options = ProcessedCli::new(args);
if processed_cli_options.target.starts_with("arm")
| processed_cli_options.target.starts_with("aarch64")
{
run(Arm::create(&processed_cli_options), processed_cli_options)
} else if processed_cli_options.target.starts_with("x86") {
run(X86::create(&processed_cli_options), processed_cli_options)
} else {
unimplemented!("Unsupported target {}", processed_cli_options.target)
}
}
fn run(test_environment: impl SupportedArchitecture, processed_cli_options: ProcessedCli) {
info!("building C binaries");
test_environment.generate_c_file();
info!("building Rust binaries");
test_environment.generate_rust_file(&processed_cli_options);
}
View on GitHub (pinned to 7088e4b63a)
Solutions
- Pass a supported --target (arm*, aarch64*, x86*) to the intrinsic-test binary.
- Add a new architecture backend implementing SupportedArchitecture and wire it into main()'s match.
- Skip the intrinsic test step for unsupported architectures in your CI matrix.
- Verify the target string is the vendor triple you expect, not a stray alias.
Example fix
// before $ intrinsic-test --target riscv64gc-unknown-linux-gnu // panics: Unsupported target riscv64gc-unknown-linux-gnu // after $ intrinsic-test --target aarch64-unknown-linux-gnu
Defensive patterns
Strategy: validation
Validate before calling
fn is_supported_target(target: &str) -> bool {
target.starts_with("arm") || target.starts_with("aarch64") || target.starts_with("x86")
}
// Before invoking intrinsic-test, assert is_supported_target(&cli.target). Prevention
- Restrict the intrinsic-test CI matrix to arm/aarch64/x86.
- Validate the --target before running the harness.
- Add a backend when introducing a new architecture.
When it happens
Trigger: Invoking the intrinsic-test binary with --target set to a triple that does not start with arm, aarch64, or x86 (e.g. riscv64, powerpc64, s390x, wasm32, mips).
Common situations: Pointing the intrinsic test harness at a newer architecture (RISC-V) or a non-supported triple during stdarch development; passing a fully-qualified target like riscv64gc-unknown-linux-gnu.
Related errors
- Unrecognized target triple {triple}
- f128
- Failed to parse `build.target` as an array of target
- expected pointee to have a layout
AI-assisted analysis of rust-lang/rust@7088e4b63a (2026-08-10).
Data as JSON: /api/errors/3b3bde487ef5387a.
Report an issue: GitHub.