@@ -545,7 +545,7 @@ impl HirEqInterExpr<'_, '_, '_> {
545545 fn eq_path_parameters ( & mut self , left : & GenericArgs < ' _ > , right : & GenericArgs < ' _ > ) -> bool {
546546 if left. parenthesized == right. parenthesized {
547547 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) )
549549 } else {
550550 false
551551 }
@@ -602,8 +602,13 @@ impl HirEqInterExpr<'_, '_, '_> {
602602 }
603603 }
604604
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) ) )
607612 }
608613
609614 fn check_ctxt ( & mut self , left : SyntaxContext , right : SyntaxContext ) -> bool {
0 commit comments