Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/diagnostics.rs')
-rw-r--r--crates/hir/src/diagnostics.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/hir/src/diagnostics.rs b/crates/hir/src/diagnostics.rs
index 18f28541af..afafede6b9 100644
--- a/crates/hir/src/diagnostics.rs
+++ b/crates/hir/src/diagnostics.rs
@@ -77,6 +77,7 @@ diagnostics![AnyDiagnostic<'db> ->
MovedOutOfRef<'db>,
NeedMut,
NonExhaustiveLet,
+ NonExhaustiveRecordExpr,
NoSuchField,
PrivateAssocItem,
PrivateField,
@@ -316,6 +317,11 @@ pub struct NonExhaustiveLet {
}
#[derive(Debug)]
+pub struct NonExhaustiveRecordExpr {
+ pub expr: InFile<ExprOrPatPtr>,
+}
+
+#[derive(Debug)]
pub struct TypeMismatch<'db> {
pub expr_or_pat: InFile<ExprOrPatPtr>,
pub expected: Type<'db>,
@@ -726,6 +732,9 @@ impl<'db> AnyDiagnostic<'db> {
let expr = expr_syntax(expr)?;
BreakOutsideOfLoop { expr, is_break, bad_value_break }.into()
}
+ &InferenceDiagnostic::NonExhaustiveRecordExpr { expr } => {
+ NonExhaustiveRecordExpr { expr: expr_syntax(expr)? }.into()
+ }
InferenceDiagnostic::TypedHole { expr, expected } => {
let expr = expr_syntax(*expr)?;
TypedHole { expr, expected: Type::new(db, def, expected.as_ref()) }.into()