File tree Expand file tree Collapse file tree 3 files changed +7
-8
lines changed
ide-diagnostics/src/handlers Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -199,8 +199,7 @@ pub struct MismatchedArgCount {
199
199
200
200
#[ derive( Debug ) ]
201
201
pub struct MissingMatchArms {
202
- pub file : HirFileId ,
203
- pub match_expr : AstPtr < ast:: Expr > ,
202
+ pub scrutinee_expr : InFile < AstPtr < ast:: Expr > > ,
204
203
pub uncovered_patterns : String ,
205
204
}
206
205
Original file line number Diff line number Diff line change @@ -1628,11 +1628,13 @@ impl DefWithBody {
1628
1628
if let ast:: Expr :: MatchExpr ( match_expr) =
1629
1629
& source_ptr. value . to_node ( & root)
1630
1630
{
1631
- if let Some ( match_expr ) = match_expr. expr ( ) {
1631
+ if let Some ( scrut_expr ) = match_expr. expr ( ) {
1632
1632
acc. push (
1633
1633
MissingMatchArms {
1634
- file : source_ptr. file_id ,
1635
- match_expr : AstPtr :: new ( & match_expr) ,
1634
+ scrutinee_expr : InFile :: new (
1635
+ source_ptr. file_id ,
1636
+ AstPtr :: new ( & scrut_expr) ,
1637
+ ) ,
1636
1638
uncovered_patterns,
1637
1639
}
1638
1640
. into ( ) ,
Original file line number Diff line number Diff line change 1
- use hir:: InFile ;
2
-
3
1
use crate :: { Diagnostic , DiagnosticsContext } ;
4
2
5
3
// Diagnostic: missing-match-arm
@@ -12,7 +10,7 @@ pub(crate) fn missing_match_arms(
12
10
Diagnostic :: new (
13
11
"missing-match-arm" ,
14
12
format ! ( "missing match arm: {}" , d. uncovered_patterns) ,
15
- ctx. sema . diagnostics_display_range ( InFile :: new ( d . file , d . match_expr . clone ( ) . into ( ) ) ) . range ,
13
+ ctx. sema . diagnostics_display_range ( d . scrutinee_expr . clone ( ) . map ( Into :: into ) ) . range ,
16
14
)
17
15
}
18
16
You can’t perform that action at this time.
0 commit comments