@@ -545,7 +545,7 @@ impl HirEqInterExpr<'_, '_, '_> {
545
545
fn eq_path_parameters ( & mut self , left : & GenericArgs < ' _ > , right : & GenericArgs < ' _ > ) -> bool {
546
546
if left. parenthesized == right. parenthesized {
547
547
over ( left. args , right. args , |l, r| self . eq_generic_arg ( l, r) ) // FIXME(flip1995): may not work
548
- && over ( left. constraints , right. constraints , |l, r| self . eq_assoc_type_binding ( l, r) )
548
+ && over ( left. constraints , right. constraints , |l, r| self . eq_assoc_eq_constraint ( l, r) )
549
549
} else {
550
550
false
551
551
}
@@ -602,8 +602,13 @@ impl HirEqInterExpr<'_, '_, '_> {
602
602
}
603
603
}
604
604
605
- fn eq_assoc_type_binding ( & mut self , left : & AssocItemConstraint < ' _ > , right : & AssocItemConstraint < ' _ > ) -> bool {
606
- left. ident . name == right. ident . name && both_some_and ( left. ty ( ) , right. ty ( ) , |l, r| self . eq_ty ( l, r) )
605
+ /// Checks whether two constraints designate the same equality constraint (same name, and same
606
+ /// type or const).
607
+ fn eq_assoc_eq_constraint ( & mut self , left : & AssocItemConstraint < ' _ > , right : & AssocItemConstraint < ' _ > ) -> bool {
608
+ // TODO: this could be extended to check for identical associated item bound constraints
609
+ left. ident . name == right. ident . name
610
+ && ( both_some_and ( left. ty ( ) , right. ty ( ) , |l, r| self . eq_ty ( l, r) )
611
+ || both_some_and ( left. ct ( ) , right. ct ( ) , |l, r| self . eq_const_arg ( l, r) ) )
607
612
}
608
613
609
614
fn check_ctxt ( & mut self , left : SyntaxContext , right : SyntaxContext ) -> bool {
0 commit comments