diff options
| author | Manas <manas18244@iiitd.ac.in> | 2022-03-30 19:02:27 +0530 |
|---|---|---|
| committer | Manas <manas18244@iiitd.ac.in> | 2022-03-30 19:07:02 +0530 |
| commit | 1be8b2ff98f6eded73cecb1f5ad20ea49ba1309a (patch) | |
| tree | 318d96b88c220e2cfb249f35c6c8c86ce1783041 | |
| parent | c8d0a9014521d96d1c81fb8f0b97919fe1035bb8 (diff) | |
| download | rust-1be8b2ff98f6eded73cecb1f5ad20ea49ba1309a.tar.gz rust-1be8b2ff98f6eded73cecb1f5ad20ea49ba1309a.zip | |
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.
| -rw-r--r-- | crates/hir_expand/src/builtin_fn_macro.rs | 2 |
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 bad5f9aa243..8d2352f06ed 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) } |
