]> git.lizzy.rs Git - rust.git/blob - src/librustc_codegen_ssa/error_codes.rs
Auto merge of #61212 - alexcrichton:skip-rustc, r=pietroalbini
[rust.git] / src / librustc_codegen_ssa / error_codes.rs
1 #![allow(non_snake_case)]
2
3 register_long_diagnostics! {
4
5 E0668: r##"
6 Malformed inline assembly rejected by LLVM.
7
8 LLVM checks the validity of the constraints and the assembly string passed to
9 it. This error implies that LLVM seems something wrong with the inline
10 assembly call.
11
12 In particular, it can happen if you forgot the closing bracket of a register
13 constraint (see issue #51430):
14 ```ignore (error-emitted-at-codegen-which-cannot-be-handled-by-compile_fail)
15 #![feature(asm)]
16
17 fn main() {
18     let rax: u64;
19     unsafe {
20         asm!("" :"={rax"(rax));
21         println!("Accumulator is: {}", rax);
22     }
23 }
24 ```
25 "##,
26
27 E0669: r##"
28 Cannot convert inline assembly operand to a single LLVM value.
29
30 This error usually happens when trying to pass in a value to an input inline
31 assembly operand that is actually a pair of values. In particular, this can
32 happen when trying to pass in a slice, for instance a `&str`. In Rust, these
33 values are represented internally as a pair of values, the pointer and its
34 length. When passed as an input operand, this pair of values can not be
35 coerced into a register and thus we must fail with an error.
36 "##,
37
38 }