aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/expr.rs
diff options
context:
space:
mode:
authorJosh Mcguigan <[email protected]>2020-04-06 14:55:25 +0100
committerJosh Mcguigan <[email protected]>2020-04-07 13:12:08 +0100
commitda6752d5f9a18ba58adb6a2e72d30a83532ec8a6 (patch)
tree5cdf566b377b80f874c2d004d4cf28bd85154e44 /crates/ra_hir_ty/src/expr.rs
parent5fe608fb31430f43a404312e284a71d6f7cfa038 (diff)
missing match arms diagnostic change source to match expression
Diffstat (limited to 'crates/ra_hir_ty/src/expr.rs')
-rw-r--r--crates/ra_hir_ty/src/expr.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/ra_hir_ty/src/expr.rs b/crates/ra_hir_ty/src/expr.rs
index 6efed6f9e..19323fda1 100644
--- a/crates/ra_hir_ty/src/expr.rs
+++ b/crates/ra_hir_ty/src/expr.rs
@@ -125,9 +125,12 @@ impl<'a, 'b> ExprValidator<'a, 'b> {
125 if let Some(expr) = source_ptr.value.left() { 125 if let Some(expr) = source_ptr.value.left() {
126 let root = source_ptr.file_syntax(db.upcast()); 126 let root = source_ptr.file_syntax(db.upcast());
127 if let ast::Expr::MatchExpr(match_expr) = expr.to_node(&root) { 127 if let ast::Expr::MatchExpr(match_expr) = expr.to_node(&root) {
128 if let Some(arms) = match_expr.match_arm_list() { 128 if let (Some(match_expr), Some(arms)) =
129 (match_expr.expr(), match_expr.match_arm_list())
130 {
129 self.sink.push(MissingMatchArms { 131 self.sink.push(MissingMatchArms {
130 file: source_ptr.file_id, 132 file: source_ptr.file_id,
133 match_expr: AstPtr::new(&match_expr),
131 arms: AstPtr::new(&arms), 134 arms: AstPtr::new(&arms),
132 }) 135 })
133 } 136 }