@@ -614,13 +614,13 @@ impl<'a, K, V> Iterator for IterMut<'a, K, V> {
614
614
}
615
615
}
616
616
617
- impl < K , V , S1 : LinearMapStorage < K , V > + ?Sized , S2 : LinearMapStorage < K , V > + ?Sized >
618
- PartialEq < LinearMapInner < K , V , S2 > > for LinearMapInner < K , V , S1 >
617
+ impl < K , V1 , V2 , S1 : LinearMapStorage < K , V1 > + ?Sized , S2 : LinearMapStorage < K , V2 > + ?Sized >
618
+ PartialEq < LinearMapInner < K , V2 , S2 > > for LinearMapInner < K , V1 , S1 >
619
619
where
620
620
K : Eq ,
621
- V : PartialEq ,
621
+ V1 : PartialEq < V2 > ,
622
622
{
623
- fn eq ( & self , other : & LinearMapInner < K , V , S2 > ) -> bool {
623
+ fn eq ( & self , other : & LinearMapInner < K , V2 , S2 > ) -> bool {
624
624
self . len ( ) == other. len ( )
625
625
&& self
626
626
. iter ( )
@@ -745,4 +745,11 @@ mod test {
745
745
) -> & ' c LinearMapView < & ' b ( ) , u32 > {
746
746
x
747
747
}
748
+
749
+ #[ test]
750
+ fn partial_eq_floats ( ) {
751
+ // Make sure `PartialEq` is implemented even if `V` doesn't implement `Eq`.
752
+ let map: LinearMap < usize , f32 , 4 > = Default :: default ( ) ;
753
+ assert_eq ! ( map, map) ;
754
+ }
748
755
}
0 commit comments