mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 11:59:49 +00:00
Diagnose incorrect usages of the question mark operator
This commit is contained in:
parent
8406380b5a
commit
381366f1dd
13 changed files with 289 additions and 125 deletions
|
@ -6,7 +6,7 @@
|
|||
use base_db::CrateId;
|
||||
use cfg::{CfgExpr, CfgOptions};
|
||||
use either::Either;
|
||||
use hir_def::path::ModPath;
|
||||
use hir_def::{path::ModPath, TraitId};
|
||||
use hir_expand::{name::Name, HirFileId, InFile};
|
||||
use syntax::{ast, AstPtr, SyntaxNodePtr, TextRange};
|
||||
|
||||
|
@ -33,6 +33,7 @@ diagnostics![
|
|||
BreakOutsideOfLoop,
|
||||
InactiveCode,
|
||||
IncorrectCase,
|
||||
IncorrectTryExpr,
|
||||
InvalidDeriveTarget,
|
||||
MacroError,
|
||||
MalformedDerive,
|
||||
|
@ -40,6 +41,7 @@ diagnostics![
|
|||
MissingFields,
|
||||
MissingMatchArms,
|
||||
MissingUnsafe,
|
||||
NotImplemented,
|
||||
NoSuchField,
|
||||
ReplaceFilterMapNextWithFindMap,
|
||||
TypeMismatch,
|
||||
|
@ -153,6 +155,16 @@ pub struct MismatchedArgCount {
|
|||
pub expected: usize,
|
||||
pub found: usize,
|
||||
}
|
||||
#[derive(Debug)]
|
||||
pub struct IncorrectTryExpr {
|
||||
pub expr: InFile<AstPtr<ast::Expr>>,
|
||||
}
|
||||
#[derive(Debug)]
|
||||
pub struct NotImplemented {
|
||||
pub expr: InFile<AstPtr<ast::Expr>>,
|
||||
pub trait_: TraitId,
|
||||
pub ty: Type,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct MissingMatchArms {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue