@@ -687,6 +687,11 @@ impl HirEqInterExpr<'_, '_, '_> {
687687 . all ( |( arg_a, arg_b) | self . eq_const_arg ( arg_a, arg_b) )
688688 } ,
689689 ( ConstArgKind :: Literal ( kind_l) , ConstArgKind :: Literal ( kind_r) ) => kind_l == kind_r,
690+ ( ConstArgKind :: Array ( l_arr) , ConstArgKind :: Array ( r_arr) ) => {
691+ l_arr. elems . len ( ) == r_arr. elems . len ( )
692+ && l_arr. elems . iter ( ) . zip ( r_arr. elems . iter ( ) )
693+ . all ( |( l_elem, r_elem) | self . eq_const_arg ( l_elem, r_elem) )
694+ }
690695 // Use explicit match for now since ConstArg is undergoing flux.
691696 (
692697 ConstArgKind :: Path ( ..)
@@ -696,6 +701,7 @@ impl HirEqInterExpr<'_, '_, '_> {
696701 | ConstArgKind :: Infer ( ..)
697702 | ConstArgKind :: Struct ( ..)
698703 | ConstArgKind :: Literal ( ..)
704+ | ConstArgKind :: Array ( ..)
699705 | ConstArgKind :: Error ( ..) ,
700706 _,
701707 ) => false ,
@@ -1575,6 +1581,11 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
15751581 self . hash_const_arg ( arg) ;
15761582 }
15771583 } ,
1584+ ConstArgKind :: Array ( array_expr) => {
1585+ for elem in array_expr. elems {
1586+ self . hash_const_arg ( elem) ;
1587+ }
1588+ } ,
15781589 ConstArgKind :: Infer ( ..) | ConstArgKind :: Error ( ..) => { } ,
15791590 ConstArgKind :: Literal ( lit) => lit. hash ( & mut self . s ) ,
15801591 }
0 commit comments