From 89b48a2e22fe4b5f3289e349ae0af81c530f7630 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Tue, 31 Jan 2023 11:54:06 +0000 Subject: [PATCH] Thread pattern types through the HIR --- clippy_lints/src/dereference.rs | 1 + clippy_utils/src/hir_utils.rs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/clippy_lints/src/dereference.rs b/clippy_lints/src/dereference.rs index 560b2acc1c7..eb317c70926 100644 --- a/clippy_lints/src/dereference.rs +++ b/clippy_lints/src/dereference.rs @@ -821,6 +821,7 @@ fn for_hir_ty<'tcx>(ty: &'tcx hir::Ty<'tcx>) -> Self { | TyKind::Array(..) | TyKind::Ptr(_) | TyKind::BareFn(_) + | TyKind::Pat(..) | TyKind::Never | TyKind::Tup(_) | TyKind::Path(_) => Self::Deref, diff --git a/clippy_utils/src/hir_utils.rs b/clippy_utils/src/hir_utils.rs index f8bbe997774..6c3d9329932 100644 --- a/clippy_utils/src/hir_utils.rs +++ b/clippy_utils/src/hir_utils.rs @@ -1068,6 +1068,10 @@ pub fn hash_tykind(&mut self, ty: &TyKind<'_>) { self.hash_ty(ty); self.hash_array_length(len); }, + TyKind::Pat(ty, pat) => { + self.hash_ty(ty); + self.hash_pat(pat); + }, TyKind::Ptr(ref mut_ty) => { self.hash_ty(mut_ty.ty); mut_ty.mutbl.hash(&mut self.s);