@@ -684,8 +684,8 @@ impl DefaultResizePolicy {
684
684
/// denial-of-service attacks (Hash DoS). This behaviour can be
685
685
/// overridden with one of the constructors.
686
686
///
687
- /// It is required that the keys implement the `PartialEq ` and `Hash` traits, although
688
- /// this can frequently be achieved by using `#[deriving(PartialEq , Hash)]`.
687
+ /// It is required that the keys implement the `Eq ` and `Hash` traits, although
688
+ /// this can frequently be achieved by using `#[deriving(Eq , Hash)]`.
689
689
///
690
690
/// Relevant papers/articles:
691
691
///
@@ -1422,6 +1422,8 @@ impl<K: Eq + Hash<S>, V: PartialEq, S, H: Hasher<S>> PartialEq for HashMap<K, V,
1422
1422
}
1423
1423
}
1424
1424
1425
+ impl < K : Eq + Hash < S > , V : Eq , S , H : Hasher < S > > Eq for HashMap < K , V , H > { }
1426
+
1425
1427
impl < K : Eq + Hash < S > + Show , V : Show , S , H : Hasher < S > > Show for HashMap < K , V , H > {
1426
1428
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1427
1429
try!( write ! ( f, r"\{" ) ) ;
@@ -1486,7 +1488,7 @@ pub type SetMoveItems<K> =
1486
1488
1487
1489
/// An implementation of a hash set using the underlying representation of a
1488
1490
/// HashMap where the value is (). As with the `HashMap` type, a `HashSet`
1489
- /// requires that the elements implement the `PartialEq ` and `Hash` traits.
1491
+ /// requires that the elements implement the `Eq ` and `Hash` traits.
1490
1492
#[ deriving( Clone ) ]
1491
1493
pub struct HashSet < T , H = sip:: SipHasher > {
1492
1494
map : HashMap < T , ( ) , H >
@@ -1500,6 +1502,8 @@ impl<T: Eq + Hash<S>, S, H: Hasher<S>> PartialEq for HashSet<T, H> {
1500
1502
}
1501
1503
}
1502
1504
1505
+ impl < T : Eq + Hash < S > , S , H : Hasher < S > > Eq for HashSet < T , H > { }
1506
+
1503
1507
impl < T : Eq + Hash < S > , S , H : Hasher < S > > Container for HashSet < T , H > {
1504
1508
fn len ( & self ) -> uint { self . map . len ( ) }
1505
1509
}
0 commit comments