Add new type-mismatch diagnostic
This commit is contained in:
@@ -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,
|
||||
@@ -147,19 +145,6 @@ pub struct MismatchedArgCount {
|
||||
pub found: usize,
|
||||
}
|
||||
|
||||
#[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,
|
||||
@@ -167,9 +152,10 @@ pub struct MissingMatchArms {
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct AddReferenceHere {
|
||||
pub struct TypeMismatch {
|
||||
pub expr: InFile<AstPtr<ast::Expr>>,
|
||||
pub mutability: Mutability,
|
||||
pub expected: Type,
|
||||
pub actual: Type,
|
||||
}
|
||||
|
||||
pub use hir_ty::diagnostics::IncorrectCase;
|
||||
|
||||
Reference in New Issue
Block a user