Assign correct span to new illegal ops
This commit is contained in:
parent
79543397d7
commit
152c06569b
@ -485,9 +485,11 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> {
|
||||
| FakeReadCause::ForGuardBinding,
|
||||
_,
|
||||
) => {
|
||||
self.super_statement(statement, location);
|
||||
self.check_op(ops::IfOrMatch);
|
||||
}
|
||||
StatementKind::LlvmInlineAsm { .. } => {
|
||||
self.super_statement(statement, location);
|
||||
self.check_op(ops::InlineAsm);
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,10 @@
|
||||
error[E0019]: constant contains unimplemented expression type
|
||||
--> $DIR/inline_asm.rs:3:1
|
||||
--> $DIR/inline_asm.rs:3:24
|
||||
|
|
||||
LL | const _: () = unsafe { llvm_asm!("nop") };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -6,9 +6,11 @@
|
||||
fn main() {}
|
||||
|
||||
// Make sure we catch executing inline assembly.
|
||||
static TEST_BAD: () = { //~ WARN: skipping const checks
|
||||
static TEST_BAD: () = {
|
||||
unsafe { llvm_asm!("xor %eax, %eax" ::: "eax"); }
|
||||
//~^ ERROR could not evaluate static initializer
|
||||
//~| NOTE in this expansion of llvm_asm!
|
||||
//~| NOTE inline assembly is not supported
|
||||
//~| WARN skipping const checks
|
||||
//~| NOTE in this expansion of llvm_asm!
|
||||
};
|
||||
|
@ -1,13 +1,10 @@
|
||||
warning: skipping const checks
|
||||
--> $DIR/inline_asm.rs:9:1
|
||||
--> $DIR/inline_asm.rs:10:14
|
||||
|
|
||||
LL | / static TEST_BAD: () = {
|
||||
LL | | unsafe { llvm_asm!("xor %eax, %eax" ::: "eax"); }
|
||||
LL | |
|
||||
LL | |
|
||||
LL | |
|
||||
LL | | };
|
||||
| |__^
|
||||
LL | unsafe { llvm_asm!("xor %eax, %eax" ::: "eax"); }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0080]: could not evaluate static initializer
|
||||
--> $DIR/inline_asm.rs:10:14
|
||||
|
Loading…
Reference in New Issue
Block a user