diff options
author | Josh Mcguigan <[email protected]> | 2020-04-06 14:55:25 +0100 |
---|---|---|
committer | Josh Mcguigan <[email protected]> | 2020-04-07 13:12:08 +0100 |
commit | da6752d5f9a18ba58adb6a2e72d30a83532ec8a6 (patch) | |
tree | 5cdf566b377b80f874c2d004d4cf28bd85154e44 /crates/ra_hir_ty/src/diagnostics.rs | |
parent | 5fe608fb31430f43a404312e284a71d6f7cfa038 (diff) |
missing match arms diagnostic change source to match expression
Diffstat (limited to 'crates/ra_hir_ty/src/diagnostics.rs')
-rw-r--r-- | crates/ra_hir_ty/src/diagnostics.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/ra_hir_ty/src/diagnostics.rs b/crates/ra_hir_ty/src/diagnostics.rs index 3457905e2..8cbce1168 100644 --- a/crates/ra_hir_ty/src/diagnostics.rs +++ b/crates/ra_hir_ty/src/diagnostics.rs | |||
@@ -65,6 +65,7 @@ impl AstDiagnostic for MissingFields { | |||
65 | #[derive(Debug)] | 65 | #[derive(Debug)] |
66 | pub struct MissingMatchArms { | 66 | pub struct MissingMatchArms { |
67 | pub file: HirFileId, | 67 | pub file: HirFileId, |
68 | pub match_expr: AstPtr<ast::Expr>, | ||
68 | pub arms: AstPtr<ast::MatchArmList>, | 69 | pub arms: AstPtr<ast::MatchArmList>, |
69 | } | 70 | } |
70 | 71 | ||
@@ -73,7 +74,7 @@ impl Diagnostic for MissingMatchArms { | |||
73 | String::from("Missing match arm") | 74 | String::from("Missing match arm") |
74 | } | 75 | } |
75 | fn source(&self) -> InFile<SyntaxNodePtr> { | 76 | fn source(&self) -> InFile<SyntaxNodePtr> { |
76 | InFile { file_id: self.file, value: self.arms.into() } | 77 | InFile { file_id: self.file, value: self.match_expr.into() } |
77 | } | 78 | } |
78 | fn as_any(&self) -> &(dyn Any + Send + 'static) { | 79 | fn as_any(&self) -> &(dyn Any + Send + 'static) { |
79 | self | 80 | self |