@@ -477,11 +477,18 @@ impl HirEqInterExpr<'_, '_, '_> {
477477 ( ConstArgKind :: Path ( l_p) , ConstArgKind :: Path ( r_p) ) => self . eq_qpath ( l_p, r_p) ,
478478 ( ConstArgKind :: Anon ( l_an) , ConstArgKind :: Anon ( r_an) ) => self . eq_body ( l_an. body , r_an. body ) ,
479479 ( ConstArgKind :: Infer ( ..) , ConstArgKind :: Infer ( ..) ) => true ,
480+ ( ConstArgKind :: Struct ( path_a, inits_a) , ConstArgKind :: Struct ( path_b, inits_b) ) => {
481+ self . eq_qpath ( path_a, path_b)
482+ && inits_a. iter ( ) . zip ( * inits_b) . all ( |( init_a, init_b) | {
483+ self . eq_const_arg ( init_a. expr , init_b. expr )
484+ } )
485+ }
480486 // Use explicit match for now since ConstArg is undergoing flux.
481- ( ConstArgKind :: Path ( ..) , ConstArgKind :: Anon ( ..) )
482- | ( ConstArgKind :: Anon ( ..) , ConstArgKind :: Path ( ..) )
483- | ( ConstArgKind :: Infer ( ..) | ConstArgKind :: Error ( ..) , _)
484- | ( _, ConstArgKind :: Infer ( ..) | ConstArgKind :: Error ( ..) ) => false ,
487+ ( ConstArgKind :: Path ( ..) , _)
488+ | ( ConstArgKind :: Anon ( ..) , _)
489+ | ( ConstArgKind :: Infer ( ..) , _)
490+ | ( ConstArgKind :: Struct ( ..) , _)
491+ | ( ConstArgKind :: Error ( ..) , _) => false ,
485492 }
486493 }
487494
@@ -1335,6 +1342,12 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
13351342 match & const_arg. kind {
13361343 ConstArgKind :: Path ( path) => self . hash_qpath ( path) ,
13371344 ConstArgKind :: Anon ( anon) => self . hash_body ( anon. body ) ,
1345+ ConstArgKind :: Struct ( path, inits) => {
1346+ self . hash_qpath ( path) ;
1347+ for init in * inits {
1348+ self . hash_const_arg ( init. expr ) ;
1349+ }
1350+ }
13381351 ConstArgKind :: Infer ( ..) | ConstArgKind :: Error ( ..) => { } ,
13391352 }
13401353 }
0 commit comments