-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #55087 - levex:e0669-improve-span, r=nagisa
rustc: improve E0669 span E0669 refers to an operand that cannot be coerced into a single LLVM value, unfortunately right now this uses the Span for the entire inline assembly statement, which is less than ideal. This commit preserves the Span from HIR, which lets us emit the error using the Span for the operand itself in MIR. r? @nagisa cc/ @parched
- Loading branch information
Showing
9 changed files
with
49 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,45 @@ | ||
error[E0669]: invalid value for constraint in inline assembly | ||
--> $DIR/inline-asm-bad-operand.rs:28:9 | ||
--> $DIR/inline-asm-bad-operand.rs:29:24 | ||
| | ||
LL | asm!("" :: "r"("")); //~ ERROR E0669 | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
| ^^ | ||
|
||
error[E0669]: invalid value for constraint in inline assembly | ||
--> $DIR/inline-asm-bad-operand.rs:33:9 | ||
--> $DIR/inline-asm-bad-operand.rs:34:32 | ||
| | ||
LL | asm!("ret" : : "{rdi}"(target)); //~ ERROR E0669 | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| ^^^^^^ | ||
|
||
error[E0669]: invalid value for constraint in inline assembly | ||
--> $DIR/inline-asm-bad-operand.rs:40:14 | ||
--> $DIR/inline-asm-bad-operand.rs:41:29 | ||
| | ||
LL | unsafe { asm!("" :: "i"(hello)) }; //~ ERROR E0669 | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
| ^^^^^ | ||
|
||
error[E0669]: invalid value for constraint in inline assembly | ||
--> $DIR/inline-asm-bad-operand.rs:48:9 | ||
--> $DIR/inline-asm-bad-operand.rs:49:38 | ||
| | ||
LL | asm!("movups $1, %xmm0"::"m"(arr)); //~ ERROR E0669 | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| ^^^ | ||
|
||
error[E0669]: invalid value for constraint in inline assembly | ||
--> $DIR/inline-asm-bad-operand.rs:55:9 | ||
--> $DIR/inline-asm-bad-operand.rs:56:32 | ||
| | ||
LL | asm!("mov sp, $0"::"r"(addr)); //~ ERROR E0669 | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| ^^^^ | ||
|
||
error: aborting due to 5 previous errors | ||
error[E0669]: invalid value for constraint in inline assembly | ||
--> $DIR/inline-asm-bad-operand.rs:63:32 | ||
| | ||
LL | asm!("mov sp, $0"::"r"(addr), //~ ERROR E0669 | ||
| ^^^^ | ||
|
||
error[E0669]: invalid value for constraint in inline assembly | ||
--> $DIR/inline-asm-bad-operand.rs:64:32 | ||
| | ||
LL | "r"("hello e0669")); //~ ERROR E0669 | ||
| ^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 7 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0669`. |