diff options
| author | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2020-04-19 16:03:35 -0700 |
|---|---|---|
| committer | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2020-04-19 17:50:56 -0700 |
| commit | 65a985e81e05bef484589fbb45dcee8e8048cda5 (patch) | |
| tree | 506a3d22cb3b9383ccf2725d6b360af3be7e6778 /src/test | |
| parent | dbf8b6bf116c7bece2987ff4bd2792f008a6ee77 (diff) | |
| download | rust-65a985e81e05bef484589fbb45dcee8e8048cda5.tar.gz rust-65a985e81e05bef484589fbb45dcee8e8048cda5.zip | |
Check for `llvm_asm` in a const context
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/consts/inline_asm.rs | 6 | ||||
| -rw-r--r-- | src/test/ui/consts/inline_asm.stderr | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/consts/inline_asm.rs b/src/test/ui/consts/inline_asm.rs new file mode 100644 index 00000000000..c2ab97e54f0 --- /dev/null +++ b/src/test/ui/consts/inline_asm.rs @@ -0,0 +1,6 @@ +#![feature(llvm_asm)] + +const _: () = unsafe { llvm_asm!("nop") }; +//~^ ERROR contains unimplemented expression type + +fn main() {} diff --git a/src/test/ui/consts/inline_asm.stderr b/src/test/ui/consts/inline_asm.stderr new file mode 100644 index 00000000000..68a78d6175f --- /dev/null +++ b/src/test/ui/consts/inline_asm.stderr @@ -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`. |
