about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-10-21 16:39:54 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-10-21 16:47:14 +0000
commit78cd77f1f129ec6d217d6bf80a7a4ff0299e54d8 (patch)
tree6bbecdba62db1c78b5da0fa8d04cf9a916ab6938
parenteb30083b6952f1564725c8027a4a63ad3f00d79c (diff)
downloadrust-78cd77f1f129ec6d217d6bf80a7a4ff0299e54d8.tar.gz
rust-78cd77f1f129ec6d217d6bf80a7a4ff0299e54d8.zip
Give better error for unsupported asm!()
-rw-r--r--src/inline_asm.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/inline_asm.rs b/src/inline_asm.rs
index 75d7f2e5c54..d809fd4bb15 100644
--- a/src/inline_asm.rs
+++ b/src/inline_asm.rs
@@ -228,6 +228,16 @@ pub(crate) fn codegen_inline_asm<'tcx>(
             fx.bcx.ins().jump(destination_block, &[]);
             return;
         }
+
+        if cfg!(not(feature = "inline_asm")) {
+            fx.tcx.sess.span_err(
+                span,
+                "asm! and global_asm! support is disabled while compiling rustc_codegen_cranelift",
+            );
+        } else {
+            fx.tcx.sess.span_err(span, "asm! and global_asm! are not yet supported on Windows");
+        }
+        return;
     }
 
     let operands = operands