Unnamed repository; edit this file 'description' to name the repository.
Type mismatch when last expression is noreturn asm
When last expression in a function body is noreturn asm, then analyzer complains about the type mismatch by highlighting entire body. This fixes it by introducing loop {} in the expanded code.
Manas 2022-03-30
parent c8d0a90 · commit 1be8b2f
-rw-r--r--crates/hir_expand/src/builtin_fn_macro.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/hir_expand/src/builtin_fn_macro.rs b/crates/hir_expand/src/builtin_fn_macro.rs
index bad5f9aa24..8d2352f06e 100644
--- a/crates/hir_expand/src/builtin_fn_macro.rs
+++ b/crates/hir_expand/src/builtin_fn_macro.rs
@@ -295,7 +295,7 @@ fn asm_expand(
let expanded = quote! {{
##literals
- ()
+ loop {}
}};
ExpandResult::ok(expanded)
}