@@ -691,7 +691,12 @@ impl HirEqInterExpr<'_, '_, '_> {
691691 }
692692 ( ConstArgKind :: Literal ( kind_l) , ConstArgKind :: Literal ( kind_r) ) => {
693693 kind_l == kind_r
694- } ,
694+ }
695+ ( ConstArgKind :: Array ( l_arr) , ConstArgKind :: Array ( r_arr) ) => {
696+ l_arr. elems . len ( ) == r_arr. elems . len ( )
697+ && l_arr. elems . iter ( ) . zip ( r_arr. elems . iter ( ) )
698+ . all ( |( l_elem, r_elem) | self . eq_const_arg ( l_elem, r_elem) )
699+ }
695700 // Use explicit match for now since ConstArg is undergoing flux.
696701 (
697702 ConstArgKind :: Path ( ..)
@@ -701,6 +706,7 @@ impl HirEqInterExpr<'_, '_, '_> {
701706 | ConstArgKind :: Infer ( ..)
702707 | ConstArgKind :: Struct ( ..)
703708 | ConstArgKind :: Literal ( ..)
709+ | ConstArgKind :: Array ( ..)
704710 | ConstArgKind :: Error ( ..) ,
705711 _,
706712 ) => false ,
@@ -1579,6 +1585,11 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
15791585 for arg in * args {
15801586 self . hash_const_arg ( arg) ;
15811587 }
1588+ }
1589+ ConstArgKind :: Array ( array_expr) => {
1590+ for elem in array_expr. elems {
1591+ self . hash_const_arg ( elem) ;
1592+ }
15821593 } ,
15831594 ConstArgKind :: Infer ( ..) | ConstArgKind :: Error ( ..) => { } ,
15841595 ConstArgKind :: Literal ( lit) => lit. hash ( & mut self . s )
0 commit comments