@@ -709,7 +709,8 @@ pub fn eq_ty(l: &Ty, r: &Ty) -> bool {
709
709
( Tup ( l) , Tup ( r) ) => over ( l, r, |l, r| eq_ty ( l, r) ) ,
710
710
( Path ( lq, lp) , Path ( rq, rp) ) => both ( lq, rq, eq_qself) && eq_path ( lp, rp) ,
711
711
( TraitObject ( lg, ls) , TraitObject ( rg, rs) ) => ls == rs && over ( lg, rg, eq_generic_bound) ,
712
- ( ImplTrait ( _, lg) , ImplTrait ( _, rg) ) => over ( lg, rg, eq_generic_bound) ,
712
+ ( ImplTrait ( _, lg, lc) , ImplTrait ( _, rg, rc) ) =>
713
+ over ( lg, rg, eq_generic_bound) && both ( lc, rc, |lc, rc| over ( lc. 0 . as_slice ( ) , rc. 0 . as_slice ( ) , eq_precise_capture) ) ,
713
714
( Typeof ( l) , Typeof ( r) ) => eq_expr ( & l. value , & r. value ) ,
714
715
( MacCall ( l) , MacCall ( r) ) => eq_mac_call ( l, r) ,
715
716
_ => false ,
@@ -770,6 +771,14 @@ pub fn eq_generic_bound(l: &GenericBound, r: &GenericBound) -> bool {
770
771
}
771
772
}
772
773
774
+ pub fn eq_precise_capture ( l : & PreciseCapturingArg , r : & PreciseCapturingArg ) -> bool {
775
+ match ( l, r) {
776
+ ( PreciseCapturingArg :: Lifetime ( l) , PreciseCapturingArg :: Lifetime ( r) ) => l. ident == r. ident ,
777
+ ( PreciseCapturingArg :: Arg ( l, _) , PreciseCapturingArg :: Arg ( r, _) ) => l. segments [ 0 ] . ident == r. segments [ 0 ] . ident ,
778
+ _ => false ,
779
+ }
780
+ }
781
+
773
782
fn eq_term ( l : & Term , r : & Term ) -> bool {
774
783
match ( l, r) {
775
784
( Term :: Ty ( l) , Term :: Ty ( r) ) => eq_ty ( l, r) ,
0 commit comments