mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Auto merge of #14326 - iDawer:refactor, r=Veykril
internal: Rename `hir::diagnostics::MissingMatchArms.match_expr` field `hir::diagnostics::MissingMatchArms.match_expr` had confusing name: it is pointing to scrutinee expression. Renamed to `scrutinee_expr` and used better fitting type for it. Also small refactorings/cleanup.
This commit is contained in:
commit
70e10deee8
4 changed files with 21 additions and 23 deletions
|
@ -199,8 +199,7 @@ pub struct MismatchedArgCount {
|
|||
|
||||
#[derive(Debug)]
|
||||
pub struct MissingMatchArms {
|
||||
pub file: HirFileId,
|
||||
pub match_expr: AstPtr<ast::Expr>,
|
||||
pub scrutinee_expr: InFile<AstPtr<ast::Expr>>,
|
||||
pub uncovered_patterns: String,
|
||||
}
|
||||
|
||||
|
|
|
@ -1628,11 +1628,13 @@ impl DefWithBody {
|
|||
if let ast::Expr::MatchExpr(match_expr) =
|
||||
&source_ptr.value.to_node(&root)
|
||||
{
|
||||
if let Some(match_expr) = match_expr.expr() {
|
||||
if let Some(scrut_expr) = match_expr.expr() {
|
||||
acc.push(
|
||||
MissingMatchArms {
|
||||
file: source_ptr.file_id,
|
||||
match_expr: AstPtr::new(&match_expr),
|
||||
scrutinee_expr: InFile::new(
|
||||
source_ptr.file_id,
|
||||
AstPtr::new(&scrut_expr),
|
||||
),
|
||||
uncovered_patterns,
|
||||
}
|
||||
.into(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue