@@ -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
@@ -1332,6 +1339,12 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
13321339 match & const_arg. kind {
13331340 ConstArgKind :: Path ( path) => self . hash_qpath ( path) ,
13341341 ConstArgKind :: Anon ( anon) => self . hash_body ( anon. body ) ,
1342+ ConstArgKind :: Struct ( path, inits) => {
1343+ self . hash_qpath ( path) ;
1344+ for init in * inits {
1345+ self . hash_const_arg ( init. expr ) ;
1346+ }
1347+ }
13351348 ConstArgKind :: Infer ( ..) | ConstArgKind :: Error ( ..) => { } ,
13361349 }
13371350 }
0 commit comments