mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 08:57:30 +00:00
Add generic arg infer
This commit is contained in:
parent
1b8fc8f13d
commit
00faed9f0c
1 changed files with 10 additions and 1 deletions
|
@ -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(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue