about summary refs log tree commit diff
path: root/clippy_utils
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2023-08-14 19:25:01 +0000
committerEsteban Küber <esteban@kuber.com.ar>2023-08-14 21:43:56 +0000
commit89fdc3e383c3ebe3a2cbddd7b49cbfe6a6cf0cf5 (patch)
tree3ccc623cae639d1d590fbd971e96702888e7c213 /clippy_utils
parentb8b3e078f99da9f07c0323eca895c2d4e431a4a4 (diff)
Move scrutinee `HirId` into `MatchSource::TryDesugar`
Diffstat (limited to 'clippy_utils')
-rw-r--r--clippy_utils/src/check_proc_macro.rs2
-rw-r--r--clippy_utils/src/lib.rs2
-rw-r--r--clippy_utils/src/visitors.rs2
3 files changed, 3 insertions, 3 deletions
diff --git a/clippy_utils/src/check_proc_macro.rs b/clippy_utils/src/check_proc_macro.rs
index 60fab1ec41a..6be8b8bb916 100644
--- a/clippy_utils/src/check_proc_macro.rs
+++ b/clippy_utils/src/check_proc_macro.rs
@@ -149,7 +149,7 @@ fn expr_search_pat(tcx: TyCtxt<'_>, e: &Expr<'_>) -> (Pat, Pat) {
             (Pat::Str("for"), Pat::Str("}"))
         },
         ExprKind::Match(_, _, MatchSource::Normal) => (Pat::Str("match"), Pat::Str("}")),
-        ExprKind::Match(e, _, MatchSource::TryDesugar) => (expr_search_pat(tcx, e).0, Pat::Str("?")),
+        ExprKind::Match(e, _, MatchSource::TryDesugar(_)) => (expr_search_pat(tcx, e).0, Pat::Str("?")),
         ExprKind::Match(e, _, MatchSource::AwaitDesugar) | ExprKind::Yield(e, YieldSource::Await { .. }) => {
             (expr_search_pat(tcx, e).0, Pat::Str("await"))
         },
diff --git a/clippy_utils/src/lib.rs b/clippy_utils/src/lib.rs
index 171b7faf219..09576d67b23 100644
--- a/clippy_utils/src/lib.rs
+++ b/clippy_utils/src/lib.rs
@@ -1765,7 +1765,7 @@ pub fn is_try<'tcx>(cx: &LateContext<'_>, expr: &'tcx Expr<'tcx>) -> Option<&'tc
 
     if let ExprKind::Match(_, arms, ref source) = expr.kind {
         // desugared from a `?` operator
-        if *source == MatchSource::TryDesugar {
+        if let MatchSource::TryDesugar(_) = *source {
             return Some(expr);
         }
 
diff --git a/clippy_utils/src/visitors.rs b/clippy_utils/src/visitors.rs
index f83988a6e32..3b47a451345 100644
--- a/clippy_utils/src/visitors.rs
+++ b/clippy_utils/src/visitors.rs
@@ -161,7 +161,7 @@ pub fn for_each_expr_with_closures<'tcx, B, C: Continue>(
 /// returns `true` if expr contains match expr desugared from try
 fn contains_try(expr: &hir::Expr<'_>) -> bool {
     for_each_expr(expr, |e| {
-        if matches!(e.kind, hir::ExprKind::Match(_, _, hir::MatchSource::TryDesugar)) {
+        if matches!(e.kind, hir::ExprKind::Match(_, _, hir::MatchSource::TryDesugar(_))) {
             ControlFlow::Break(())
         } else {
             ControlFlow::Continue(())