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:
bors 2023-03-11 07:36:00 +00:00
commit 70e10deee8
4 changed files with 21 additions and 23 deletions

View file

@ -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(),