From b292e1b9da39813e2739cb450c263e7502c97c8d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 13 Jun 2021 21:44:31 +0300 Subject: internal: refactor missing match arms diagnostics --- crates/hir/src/diagnostics.rs | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'crates/hir/src/diagnostics.rs') diff --git a/crates/hir/src/diagnostics.rs b/crates/hir/src/diagnostics.rs index c2d608eb5..5cffef47f 100644 --- a/crates/hir/src/diagnostics.rs +++ b/crates/hir/src/diagnostics.rs @@ -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, } -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 { - 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, -- cgit v1.2.3