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.rs25
1 files changed, 6 insertions, 19 deletions
diff --git a/crates/hir/src/diagnostics.rs b/crates/hir/src/diagnostics.rs
index b5e7d5db63..bc43fb15ee 100644
--- a/crates/hir/src/diagnostics.rs
+++ b/crates/hir/src/diagnostics.rs
@@ -5,7 +5,7 @@
//! be expressed in terms of hir types themselves.
use cfg::{CfgExpr, CfgOptions};
use either::Either;
-use hir_def::{path::ModPath, type_ref::Mutability};
+use hir_def::path::ModPath;
use hir_expand::{name::Name, HirFileId, InFile};
use syntax::{ast, AstPtr, SyntaxNodePtr, TextRange};
@@ -28,7 +28,6 @@ macro_rules! diagnostics {
}
diagnostics![
- AddReferenceHere,
BreakOutsideOfLoop,
InactiveCode,
IncorrectCase,
@@ -38,11 +37,10 @@ diagnostics![
MismatchedArgCount,
MissingFields,
MissingMatchArms,
- MissingOkOrSomeInTailExpr,
MissingUnsafe,
NoSuchField,
- RemoveThisSemicolon,
ReplaceFilterMapNextWithFindMap,
+ TypeMismatch,
UnimplementedBuiltinMacro,
UnresolvedExternCrate,
UnresolvedImport,
@@ -148,28 +146,17 @@ pub struct MismatchedArgCount {
}
#[derive(Debug)]
-pub struct RemoveThisSemicolon {
- pub expr: InFile<AstPtr<ast::Expr>>,
-}
-
-#[derive(Debug)]
-pub struct MissingOkOrSomeInTailExpr {
- pub expr: InFile<AstPtr<ast::Expr>>,
- // `Some` or `Ok` depending on whether the return type is Result or Option
- pub required: String,
- pub expected: Type,
-}
-
-#[derive(Debug)]
pub struct MissingMatchArms {
pub file: HirFileId,
pub match_expr: AstPtr<ast::Expr>,
}
#[derive(Debug)]
-pub struct AddReferenceHere {
+pub struct TypeMismatch {
+ // FIXME: add mismatches in patterns as well
pub expr: InFile<AstPtr<ast::Expr>>,
- pub mutability: Mutability,
+ pub expected: Type,
+ pub actual: Type,
}
pub use hir_ty::diagnostics::IncorrectCase;