Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/infer/expr.rs')
-rw-r--r--crates/hir-ty/src/infer/expr.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/crates/hir-ty/src/infer/expr.rs b/crates/hir-ty/src/infer/expr.rs
index 62339779a5..c57d41cc5f 100644
--- a/crates/hir-ty/src/infer/expr.rs
+++ b/crates/hir-ty/src/infer/expr.rs
@@ -8,7 +8,7 @@ use hir_def::{
expr_store::path::{GenericArgs as HirGenericArgs, Path},
hir::{
Array, AsmOperand, AsmOptions, BinaryOp, BindingAnnotation, Expr, ExprId, ExprOrPatId,
- LabelId, Literal, Pat, PatId, Statement, UnaryOp,
+ InlineAsmKind, LabelId, Literal, Pat, PatId, Statement, UnaryOp,
},
resolver::ValueNs,
};
@@ -1037,7 +1037,11 @@ impl<'db> InferenceContext<'_, 'db> {
// FIXME: `sym` should report for things that are not functions or statics.
AsmOperand::Sym(_) => (),
});
- if diverge { self.types.types.never } else { self.types.types.unit }
+ if diverge || asm.kind == InlineAsmKind::NakedAsm {
+ self.types.types.never
+ } else {
+ self.types.types.unit
+ }
}
};
// use a new type variable if we got unknown here