@@ -288,6 +288,8 @@ impl HirEqInterExpr<'_, '_, '_> {
288288 ( GenericArg :: Const ( l) , GenericArg :: Const ( r) ) => self . eq_body ( l. value . body , r. value . body ) ,
289289 ( GenericArg :: Lifetime ( l_lt) , GenericArg :: Lifetime ( r_lt) ) => Self :: eq_lifetime ( l_lt, r_lt) ,
290290 ( 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 ( ) ) ,
291293 _ => false ,
292294 }
293295 }
@@ -885,7 +887,11 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
885887
886888 pub fn hash_ty ( & mut self , ty : & Ty < ' _ > ) {
887889 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 {
889895 TyKind :: Slice ( ty) => {
890896 self . hash_ty ( ty) ;
891897 } ,
@@ -898,7 +904,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
898904 mut_ty. mutbl . hash ( & mut self . s ) ;
899905 } ,
900906 TyKind :: Rptr ( lifetime, ref mut_ty) => {
901- self . hash_lifetime ( lifetime) ;
907+ self . hash_lifetime ( * lifetime) ;
902908 self . hash_ty ( mut_ty. ty ) ;
903909 mut_ty. mutbl . hash ( & mut self . s ) ;
904910 } ,
@@ -918,7 +924,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
918924 bfn. decl . c_variadic . hash ( & mut self . s ) ;
919925 } ,
920926 TyKind :: Tup ( ty_list) => {
921- for ty in ty_list {
927+ for ty in * ty_list {
922928 self . hash_ty ( ty) ;
923929 }
924930 } ,
@@ -927,7 +933,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
927933 self . hash_generic_args ( arg_list) ;
928934 } ,
929935 TyKind :: TraitObject ( _, lifetime, _) => {
930- self . hash_lifetime ( lifetime) ;
936+ self . hash_lifetime ( * lifetime) ;
931937 } ,
932938 TyKind :: Typeof ( anon_const) => {
933939 self . hash_body ( anon_const. body ) ;
@@ -949,6 +955,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
949955 GenericArg :: Lifetime ( l) => self . hash_lifetime ( l) ,
950956 GenericArg :: Type ( ref ty) => self . hash_ty ( ty) ,
951957 GenericArg :: Const ( ref ca) => self . hash_body ( ca. value . body ) ,
958+ GenericArg :: Infer ( ref inf) => self . hash_ty ( & inf. to_ty ( ) ) ,
952959 }
953960 }
954961 }
0 commit comments