Skip to content

Commit 259182b

Browse files
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](#11820) Co-authored-by: Manas <[email protected]>
2 parents c8d0a90 + 1be8b2f commit 259182b

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)