This repository was archived by the owner on May 28, 2025. It is now read-only.
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 {
199199
200200#[ derive( Debug ) ]
201201pub struct MissingMatchArms {
202- pub file : HirFileId ,
203- pub match_expr : AstPtr < ast:: Expr > ,
202+ pub scrutinee_expr : InFile < AstPtr < ast:: Expr > > ,
204203 pub uncovered_patterns : String ,
205204}
206205
Original file line number Diff line number Diff line change @@ -1628,11 +1628,13 @@ impl DefWithBody {
16281628 if let ast:: Expr :: MatchExpr ( match_expr) =
16291629 & source_ptr. value . to_node ( & root)
16301630 {
1631- if let Some ( match_expr ) = match_expr. expr ( ) {
1631+ if let Some ( scrut_expr ) = match_expr. expr ( ) {
16321632 acc. push (
16331633 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+ ) ,
16361638 uncovered_patterns,
16371639 }
16381640 . into ( ) ,
Original file line number Diff line number Diff line change 1- use hir:: InFile ;
2-
31use crate :: { Diagnostic , DiagnosticsContext } ;
42
53// Diagnostic: missing-match-arm
@@ -12,7 +10,7 @@ pub(crate) fn missing_match_arms(
1210 Diagnostic :: new (
1311 "missing-match-arm" ,
1412 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 ,
1614 )
1715}
1816
You can’t perform that action at this time.
0 commit comments