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.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/crates/hir/src/diagnostics.rs b/crates/hir/src/diagnostics.rs
index 1009a8b31b..8f9465cf1b 100644
--- a/crates/hir/src/diagnostics.rs
+++ b/crates/hir/src/diagnostics.rs
@@ -8,7 +8,7 @@ use either::Either;
use hir_def::{
DefWithBodyId, GenericParamId, SyntheticSyntax,
expr_store::{
- ExprOrPatPtr, ExpressionStoreSourceMap, hir_assoc_type_binding_to_ast,
+ ExprOrPatPtr, ExprOrPatSource, ExpressionStoreSourceMap, hir_assoc_type_binding_to_ast,
hir_generic_arg_to_ast, hir_segment_to_ast_segment,
},
hir::ExprOrPatId,
@@ -108,6 +108,7 @@ diagnostics![AnyDiagnostic<'db> ->
IncorrectGenericsOrder,
MissingLifetime,
ElidedLifetimesInPath,
+ TypeMustBeKnown,
];
#[derive(Debug)]
@@ -444,6 +445,11 @@ pub struct ElidedLifetimesInPath {
pub hard_error: bool,
}
+#[derive(Debug)]
+pub struct TypeMustBeKnown {
+ pub at_point: ExprOrPatSource,
+}
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum GenericArgKind {
Lifetime,
@@ -800,6 +806,9 @@ impl<'db> AnyDiagnostic<'db> {
let lhs = expr_syntax(lhs)?;
InvalidLhsOfAssignment { lhs }.into()
}
+ &InferenceDiagnostic::TypeMustBeKnown { at_point } => {
+ TypeMustBeKnown { at_point: expr_or_pat_syntax(at_point)? }.into()
+ }
})
}