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