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

  1. Pass a supported --target (arm*, aarch64*, x86*) to the intrinsic-test binary.
  2. Add a new architecture backend implementing SupportedArchitecture and wire it into main()'s match.
  3. Skip the intrinsic test step for unsupported architectures in your CI matrix.
  4. 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

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


AI-assisted analysis of rust-lang/rust@7088e4b63a (2026-08-10). Data as JSON: /api/errors/3b3bde487ef5387a. Report an issue: GitHub.