Skip to content

Commit 1be8b2f

Browse files
committed
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.
1 parent c8d0a90 commit 1be8b2f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/hir_expand/src/builtin_fn_macro.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ fn asm_expand(
295295

296296
let expanded = quote! {{
297297
##literals
298-
()
298+
loop {}
299299
}};
300300
ExpandResult::ok(expanded)
301301
}

0 commit comments

Comments
 (0)