Skip to content

Commit ccd0965

Browse files
sfackleralexcrichton
authored andcommitted
---
yaml --- r: 152334 b: refs/heads/try2 c: b662aa5 h: refs/heads/master v: v3
1 parent 214f8eb commit ccd0965

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 1bde6e3fcb32ca00cf8a8dfa0977e47f7f4a77bf
8+
refs/heads/try2: b662aa5ec0eb1971111bf10f9c3ef2a8f226bb0a
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libstd/collections/hashmap.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -684,8 +684,8 @@ impl DefaultResizePolicy {
684684
/// denial-of-service attacks (Hash DoS). This behaviour can be
685685
/// overridden with one of the constructors.
686686
///
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)]`.
689689
///
690690
/// Relevant papers/articles:
691691
///
@@ -1422,6 +1422,8 @@ impl<K: Eq + Hash<S>, V: PartialEq, S, H: Hasher<S>> PartialEq for HashMap<K, V,
14221422
}
14231423
}
14241424

1425+
impl<K: Eq + Hash<S>, V: Eq, S, H: Hasher<S>> Eq for HashMap<K, V, H> {}
1426+
14251427
impl<K: Eq + Hash<S> + Show, V: Show, S, H: Hasher<S>> Show for HashMap<K, V, H> {
14261428
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
14271429
try!(write!(f, r"\{"));
@@ -1486,7 +1488,7 @@ pub type SetMoveItems<K> =
14861488

14871489
/// An implementation of a hash set using the underlying representation of a
14881490
/// 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.
14901492
#[deriving(Clone)]
14911493
pub struct HashSet<T, H = sip::SipHasher> {
14921494
map: HashMap<T, (), H>
@@ -1500,6 +1502,8 @@ impl<T: Eq + Hash<S>, S, H: Hasher<S>> PartialEq for HashSet<T, H> {
15001502
}
15011503
}
15021504

1505+
impl<T: Eq + Hash<S>, S, H: Hasher<S>> Eq for HashSet<T, H> {}
1506+
15031507
impl<T: Eq + Hash<S>, S, H: Hasher<S>> Container for HashSet<T, H> {
15041508
fn len(&self) -> uint { self.map.len() }
15051509
}

0 commit comments

Comments
 (0)