Check for llvm_asm in a const context
This commit is contained in:
parent
dbf8b6bf11
commit
65a985e81e
4 changed files with 23 additions and 1 deletions
6
src/test/ui/consts/inline_asm.rs
Normal file
6
src/test/ui/consts/inline_asm.rs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#![feature(llvm_asm)]
|
||||
|
||||
const _: () = unsafe { llvm_asm!("nop") };
|
||||
//~^ ERROR contains unimplemented expression type
|
||||
|
||||
fn main() {}
|
||||
9
src/test/ui/consts/inline_asm.stderr
Normal file
9
src/test/ui/consts/inline_asm.stderr
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
error[E0019]: constant contains unimplemented expression type
|
||||
--> $DIR/inline_asm.rs:3:1
|
||||
|
|
||||
LL | const _: () = unsafe { llvm_asm!("nop") };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0019`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue