Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 00faed9

Browse files
committed
Add generic arg infer
1 parent 1b8fc8f commit 00faed9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

clippy_utils/src/hir_utils.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,15 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
885885

886886
pub fn hash_ty(&mut self, ty: &Ty<'_>) {
887887
std::mem::discriminant(&ty.kind).hash(&mut self.s);
888-
match ty.kind {
888+
self.hash_tykind(&ty.kind);
889+
}
890+
891+
pub fn hash_infer(&mut self) {
892+
"_".hash(&mut self.s);
893+
}
894+
895+
pub fn hash_tykind(&mut self, ty: &TyKind<'_>) {
896+
match ty {
889897
TyKind::Slice(ty) => {
890898
self.hash_ty(ty);
891899
},
@@ -949,6 +957,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
949957
GenericArg::Lifetime(l) => self.hash_lifetime(l),
950958
GenericArg::Type(ref ty) => self.hash_ty(ty),
951959
GenericArg::Const(ref ca) => self.hash_body(ca.value.body),
960+
GenericArg::Infer(ref _inf) => self.hash_infer(),
952961
}
953962
}
954963
}

0 commit comments

Comments
 (0)