Unnamed repository; edit this file 'description' to name the repository.
Merge #11852
11852: Type mismatch when last expression is noreturn asm r=lnicola a=weirdsmiley 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. Fixes: [#11820](https://github.com/rust-analyzer/rust-analyzer/issues/11820) Co-authored-by: Manas <[email protected]>
bors[bot] 2022-03-30
parent c8d0a90 · parent 1be8b2f · commit 259182b
-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)
}