Email me

Rust errors / Attributes, macros and features

Rust compiler error · checked with rustc 1.99.0

Rust error E0472: inline assembly (`asm!`) is not supported on this target

What it meansInline assembly (asm!) is not supported on this target.

E0472Attributes, macros and features
Activein rustc 1.99.0
5related errors linked below

The compiler team's explanation

Inline assembly (asm!) is not supported on this target.

Example of erroneous code:

// compile-flags: --target sparc64-unknown-linux-gnu
#![no_std]

use core::arch::asm;

fn main() {
    unsafe {
        asm!(""); // error: inline assembly is not supported on this target
    }
}

The Rust compiler does not support inline assembly, with the asm! macro (previously llvm_asm!), for all targets. All Tier 1 targets do support this macro but support among Tier 2 and 3 targets is not guaranteed (even when they have std support). Note that this error is related to error[E0658]: inline assembly is not stable yet on this architecture, but distinct in that with E0472 support is not planned or in progress.

There is no way to easily fix this issue, however:

  • Consider if you really need inline assembly, is there some other way to achieve your goal (intrinsics, etc)?
  • Consider writing your assembly externally, linking with it and calling it from Rust.
  • Consider contributing to <https://github.com/rust-lang/rust> and help integrate support for your target!

From rustc --explain E0472 (1.99.0), part of the Rust project, MIT or Apache-2.0. Official page.

Related errors

All 518 Rust error codes · Rust crate data · Glossary

Up next

Often hit nextE0658: is unstableA related error from the same family.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ