mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 11:59:49 +00:00
internal: refactor missing match arms diagnostics
This commit is contained in:
parent
3478897f86
commit
b292e1b9da
4 changed files with 935 additions and 930 deletions
|
@ -38,6 +38,7 @@ diagnostics![
|
|||
MacroError,
|
||||
MismatchedArgCount,
|
||||
MissingFields,
|
||||
MissingMatchArms,
|
||||
MissingOkOrSomeInTailExpr,
|
||||
MissingUnsafe,
|
||||
NoSuchField,
|
||||
|
@ -149,9 +150,6 @@ pub struct MissingOkOrSomeInTailExpr {
|
|||
pub required: String,
|
||||
}
|
||||
|
||||
// Diagnostic: missing-match-arm
|
||||
//
|
||||
// This diagnostic is triggered if `match` block is missing one or more match arms.
|
||||
#[derive(Debug)]
|
||||
pub struct MissingMatchArms {
|
||||
pub file: HirFileId,
|
||||
|
@ -159,21 +157,6 @@ pub struct MissingMatchArms {
|
|||
pub arms: AstPtr<ast::MatchArmList>,
|
||||
}
|
||||
|
||||
impl Diagnostic for MissingMatchArms {
|
||||
fn code(&self) -> DiagnosticCode {
|
||||
DiagnosticCode("missing-match-arm")
|
||||
}
|
||||
fn message(&self) -> String {
|
||||
String::from("Missing match arm")
|
||||
}
|
||||
fn display_source(&self) -> InFile<SyntaxNodePtr> {
|
||||
InFile { file_id: self.file, value: self.match_expr.clone().into() }
|
||||
}
|
||||
fn as_any(&self) -> &(dyn Any + Send + 'static) {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct InternalBailedOut {
|
||||
pub file: HirFileId,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue