Move scrutinee HirId into MatchSource::TryDesugar

This commit is contained in:
Esteban Küber 2023-08-14 19:25:01 +00:00
parent b8b3e078f9
commit 89fdc3e383
14 changed files with 15 additions and 14 deletions

View file

@ -64,7 +64,7 @@ pub(super) fn check(
ExprKind::Path(QPath::LangItem(rustc_hir::LangItem::TryTraitBranch, _, _))
),
ExprKind::MethodCall(_, self_arg, ..) if expr.hir_id == self_arg.hir_id => true,
ExprKind::Match(_, _, MatchSource::TryDesugar | MatchSource::AwaitDesugar)
ExprKind::Match(_, _, MatchSource::TryDesugar(_) | MatchSource::AwaitDesugar)
| ExprKind::Field(..)
| ExprKind::Index(..) => true,
_ => false,

View file

@ -236,7 +236,7 @@ fn indirect_usage<'tcx>(
!matches!(
node,
Node::Expr(Expr {
kind: ExprKind::Match(.., MatchSource::TryDesugar),
kind: ExprKind::Match(.., MatchSource::TryDesugar(_)),
..
})
)