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.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/hir/src/diagnostics.rs b/crates/hir/src/diagnostics.rs
index ed073cb437..616b063419 100644
--- a/crates/hir/src/diagnostics.rs
+++ b/crates/hir/src/diagnostics.rs
@@ -135,6 +135,7 @@ diagnostics![AnyDiagnostic<'db> ->
MissingMatchArms,
MissingUnsafe,
MovedOutOfRef<'db>,
+ MutRefInImmRefPat,
MutableRefBinding,
NeedMut,
NonExhaustiveLet,
@@ -338,6 +339,11 @@ pub struct CannotBeDereferenced<'db> {
}
#[derive(Debug)]
+pub struct MutRefInImmRefPat {
+ pub pat: InFile<ExprOrPatPtr>,
+}
+
+#[derive(Debug)]
pub struct CannotImplicitlyDerefTraitObject<'db> {
pub pat: InFile<ExprOrPatPtr>,
pub found: Type<'db>,
@@ -960,6 +966,10 @@ impl<'db> AnyDiagnostic<'db> {
let expr = expr_syntax(*expr)?;
CannotBeDereferenced { expr, found: new_ty(found.as_ref()) }.into()
}
+ InferenceDiagnostic::MutRefInImmRefPat { pat } => {
+ let pat = pat_syntax(*pat)?.map(Into::into);
+ MutRefInImmRefPat { pat }.into()
+ }
InferenceDiagnostic::CannotImplicitlyDerefTraitObject { pat, found } => {
let pat = pat_syntax(*pat)?.map(Into::into);
CannotImplicitlyDerefTraitObject { pat, found: new_ty(found.as_ref()) }.into()