internal: refactor missing match arms diagnostics
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user