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