@@ -288,6 +288,8 @@ impl HirEqInterExpr<'_, '_, '_> {
288
288
( GenericArg :: Const ( l) , GenericArg :: Const ( r) ) => self . eq_body ( l. value . body , r. value . body ) ,
289
289
( GenericArg :: Lifetime ( l_lt) , GenericArg :: Lifetime ( r_lt) ) => Self :: eq_lifetime ( l_lt, r_lt) ,
290
290
( GenericArg :: Type ( l_ty) , GenericArg :: Type ( r_ty) ) => self . eq_ty ( l_ty, r_ty) ,
291
+ ( GenericArg :: Infer ( l_inf) , GenericArg :: Infer ( r_inf) ) =>
292
+ self . eq_ty ( & l_inf. to_ty ( ) , & r_inf. to_ty ( ) ) ,
291
293
_ => false ,
292
294
}
293
295
}
@@ -885,7 +887,11 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
885
887
886
888
pub fn hash_ty ( & mut self , ty : & Ty < ' _ > ) {
887
889
std:: mem:: discriminant ( & ty. kind ) . hash ( & mut self . s ) ;
888
- match ty. kind {
890
+ self . hash_tykind ( & ty. kind ) ;
891
+ }
892
+
893
+ pub fn hash_tykind ( & mut self , ty : & TyKind < ' _ > ) {
894
+ match ty {
889
895
TyKind :: Slice ( ty) => {
890
896
self . hash_ty ( ty) ;
891
897
} ,
@@ -898,7 +904,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
898
904
mut_ty. mutbl . hash ( & mut self . s ) ;
899
905
} ,
900
906
TyKind :: Rptr ( lifetime, ref mut_ty) => {
901
- self . hash_lifetime ( lifetime) ;
907
+ self . hash_lifetime ( * lifetime) ;
902
908
self . hash_ty ( mut_ty. ty ) ;
903
909
mut_ty. mutbl . hash ( & mut self . s ) ;
904
910
} ,
@@ -918,7 +924,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
918
924
bfn. decl . c_variadic . hash ( & mut self . s ) ;
919
925
} ,
920
926
TyKind :: Tup ( ty_list) => {
921
- for ty in ty_list {
927
+ for ty in * ty_list {
922
928
self . hash_ty ( ty) ;
923
929
}
924
930
} ,
@@ -927,7 +933,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
927
933
self . hash_generic_args ( arg_list) ;
928
934
} ,
929
935
TyKind :: TraitObject ( _, lifetime, _) => {
930
- self . hash_lifetime ( lifetime) ;
936
+ self . hash_lifetime ( * lifetime) ;
931
937
} ,
932
938
TyKind :: Typeof ( anon_const) => {
933
939
self . hash_body ( anon_const. body ) ;
@@ -949,6 +955,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
949
955
GenericArg :: Lifetime ( l) => self . hash_lifetime ( l) ,
950
956
GenericArg :: Type ( ref ty) => self . hash_ty ( ty) ,
951
957
GenericArg :: Const ( ref ca) => self . hash_body ( ca. value . body ) ,
958
+ GenericArg :: Infer ( ref inf) => self . hash_ty ( & inf. to_ty ( ) ) ,
952
959
}
953
960
}
954
961
}
0 commit comments