diff options
| author | kadmin <julianknodt@gmail.com> | 2021-04-24 21:41:57 +0000 |
|---|---|---|
| committer | kadmin <julianknodt@gmail.com> | 2021-07-25 07:28:51 +0000 |
| commit | 00faed9f0cb0129dc39d3f6ea769df35c68a4d05 (patch) | |
| tree | 1cdc0c8eca49f7bbbf1815d5cf664d4be70246c8 | |
| parent | 1b8fc8f13d9f3874ae88c482807c24c2218e4179 (diff) | |
| download | rust-00faed9f0cb0129dc39d3f6ea769df35c68a4d05.tar.gz rust-00faed9f0cb0129dc39d3f6ea769df35c68a4d05.zip | |
Add generic arg infer
| -rw-r--r-- | clippy_utils/src/hir_utils.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/clippy_utils/src/hir_utils.rs b/clippy_utils/src/hir_utils.rs index a21ad42c061..63737955f09 100644 --- a/clippy_utils/src/hir_utils.rs +++ b/clippy_utils/src/hir_utils.rs @@ -885,7 +885,15 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> { pub fn hash_ty(&mut self, ty: &Ty<'_>) { std::mem::discriminant(&ty.kind).hash(&mut self.s); - match ty.kind { + self.hash_tykind(&ty.kind); + } + + pub fn hash_infer(&mut self) { + "_".hash(&mut self.s); + } + + pub fn hash_tykind(&mut self, ty: &TyKind<'_>) { + match ty { TyKind::Slice(ty) => { self.hash_ty(ty); }, @@ -949,6 +957,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> { GenericArg::Lifetime(l) => self.hash_lifetime(l), GenericArg::Type(ref ty) => self.hash_ty(ty), GenericArg::Const(ref ca) => self.hash_body(ca.value.body), + GenericArg::Infer(ref _inf) => self.hash_infer(), } } } |
