summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src/error_codes/E0472.md
blob: 0005cd41911a9295c8047b920b36e2a6e42b39d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Inline assembly (`asm!`) is not supported on this target.

Example of erroneous code:

```ignore (cannot-change-target)
// 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!