@@ -288,6 +288,7 @@ 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) ) => self . eq_ty ( & l_inf. to_ty ( ) , & r_inf. to_ty ( ) ) ,
291292 _ => false ,
292293 }
293294 }
@@ -885,7 +886,11 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
885886
886887 pub fn hash_ty ( & mut self , ty : & Ty < ' _ > ) {
887888 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 {
889894 TyKind :: Slice ( ty) => {
890895 self . hash_ty ( ty) ;
891896 } ,
@@ -898,7 +903,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
898903 mut_ty. mutbl . hash ( & mut self . s ) ;
899904 } ,
900905 TyKind :: Rptr ( lifetime, ref mut_ty) => {
901- self . hash_lifetime ( lifetime) ;
906+ self . hash_lifetime ( * lifetime) ;
902907 self . hash_ty ( mut_ty. ty ) ;
903908 mut_ty. mutbl . hash ( & mut self . s ) ;
904909 } ,
@@ -918,7 +923,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
918923 bfn. decl . c_variadic . hash ( & mut self . s ) ;
919924 } ,
920925 TyKind :: Tup ( ty_list) => {
921- for ty in ty_list {
926+ for ty in * ty_list {
922927 self . hash_ty ( ty) ;
923928 }
924929 } ,
@@ -927,7 +932,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
927932 self . hash_generic_args ( arg_list) ;
928933 } ,
929934 TyKind :: TraitObject ( _, lifetime, _) => {
930- self . hash_lifetime ( lifetime) ;
935+ self . hash_lifetime ( * lifetime) ;
931936 } ,
932937 TyKind :: Typeof ( anon_const) => {
933938 self . hash_body ( anon_const. body ) ;
@@ -949,6 +954,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
949954 GenericArg :: Lifetime ( l) => self . hash_lifetime ( l) ,
950955 GenericArg :: Type ( ref ty) => self . hash_ty ( ty) ,
951956 GenericArg :: Const ( ref ca) => self . hash_body ( ca. value . body ) ,
957+ GenericArg :: Infer ( ref inf) => self . hash_ty ( & inf. to_ty ( ) ) ,
952958 }
953959 }
954960 }
0 commit comments