Skip to content

Commit c3b3a86

Browse files
committed
Remove unnecessary Hash bounds from various types.
1 parent 77c50dc commit c3b3a86

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

src/bootstrap/cache.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ impl Ord for Interned<String> {
161161
}
162162
}
163163

164-
struct TyIntern<T: Hash + Clone + Eq> {
164+
struct TyIntern<T: Clone + Eq> {
165165
items: Vec<T>,
166166
set: HashMap<T, Interned<T>>,
167167
}

src/librustc/ty/fast_reject.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub type SimplifiedType = SimplifiedTypeGen<DefId>;
1919
/// the non-stable but fast to construct DefId-version is the better choice.
2020
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, RustcEncodable, RustcDecodable)]
2121
pub enum SimplifiedTypeGen<D>
22-
where D: Copy + Debug + Ord + Eq + Hash
22+
where D: Copy + Debug + Ord + Eq
2323
{
2424
BoolSimplifiedType,
2525
CharSimplifiedType,
@@ -123,10 +123,10 @@ pub fn simplify_type(
123123
}
124124
}
125125

126-
impl<D: Copy + Debug + Ord + Eq + Hash> SimplifiedTypeGen<D> {
126+
impl<D: Copy + Debug + Ord + Eq> SimplifiedTypeGen<D> {
127127
pub fn map_def<U, F>(self, map: F) -> SimplifiedTypeGen<U>
128128
where F: Fn(D) -> U,
129-
U: Copy + Debug + Ord + Eq + Hash,
129+
U: Copy + Debug + Ord + Eq,
130130
{
131131
match self {
132132
BoolSimplifiedType => BoolSimplifiedType,
@@ -155,7 +155,7 @@ impl<D: Copy + Debug + Ord + Eq + Hash> SimplifiedTypeGen<D> {
155155

156156
impl<'a, D> HashStable<StableHashingContext<'a>> for SimplifiedTypeGen<D>
157157
where
158-
D: Copy + Debug + Ord + Eq + Hash + HashStable<StableHashingContext<'a>>,
158+
D: Copy + Debug + Ord + Eq + HashStable<StableHashingContext<'a>>,
159159
{
160160
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
161161
mem::discriminant(self).hash_stable(hcx, hasher);

src/librustc_data_structures/sharded.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl<T> Sharded<T> {
9090

9191
pub type ShardedHashMap<K, V> = Sharded<FxHashMap<K, V>>;
9292

93-
impl<K: Eq + Hash, V> ShardedHashMap<K, V> {
93+
impl<K: Eq, V> ShardedHashMap<K, V> {
9494
pub fn len(&self) -> usize {
9595
self.lock_shards().iter().map(|shard| shard.len()).sum()
9696
}

src/librustc_data_structures/snapshot_map/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::mem;
77
mod tests;
88

99
pub struct SnapshotMap<K, V>
10-
where K: Hash + Clone + Eq
10+
where K: Clone + Eq
1111
{
1212
map: FxHashMap<K, V>,
1313
undo_log: Vec<UndoLog<K, V>>,

src/librustc_data_structures/stable_hasher.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ impl_stable_hash_via_hash!(::std::path::Path);
460460
impl_stable_hash_via_hash!(::std::path::PathBuf);
461461

462462
impl<K, V, R, HCX> HashStable<HCX> for ::std::collections::HashMap<K, V, R>
463-
where K: ToStableHashKey<HCX> + Eq + Hash,
463+
where K: ToStableHashKey<HCX> + Eq,
464464
V: HashStable<HCX>,
465465
R: BuildHasher,
466466
{
@@ -471,7 +471,7 @@ impl<K, V, R, HCX> HashStable<HCX> for ::std::collections::HashMap<K, V, R>
471471
}
472472

473473
impl<K, R, HCX> HashStable<HCX> for ::std::collections::HashSet<K, R>
474-
where K: ToStableHashKey<HCX> + Eq + Hash,
474+
where K: ToStableHashKey<HCX> + Eq,
475475
R: BuildHasher,
476476
{
477477
fn hash_stable(&self, hcx: &mut HCX, hasher: &mut StableHasher) {
@@ -513,7 +513,7 @@ pub fn hash_stable_hashmap<HCX, K, V, R, SK, F>(
513513
hasher: &mut StableHasher,
514514
map: &::std::collections::HashMap<K, V, R>,
515515
to_stable_hash_key: F)
516-
where K: Eq + Hash,
516+
where K: Eq,
517517
V: HashStable<HCX>,
518518
R: BuildHasher,
519519
SK: HashStable<HCX> + Ord + Clone,

src/librustc_mir/borrow_check/nll/member_constraints.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use syntax_pos::Span;
1111
/// indexed by the region `R0`.
1212
crate struct MemberConstraintSet<'tcx, R>
1313
where
14-
R: Copy + Hash + Eq,
14+
R: Copy + Eq,
1515
{
1616
/// Stores the first "member" constraint for a given `R0`. This is an
1717
/// index into the `constraints` vector below.
@@ -191,7 +191,7 @@ where
191191

192192
impl<'tcx, R> Index<NllMemberConstraintIndex> for MemberConstraintSet<'tcx, R>
193193
where
194-
R: Copy + Hash + Eq,
194+
R: Copy + Eq,
195195
{
196196
type Output = NllMemberConstraint<'tcx>;
197197

src/libserialize/collection_impls.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ impl<T> Decodable for BTreeSet<T>
143143
}
144144

145145
impl<K, V, S> Encodable for HashMap<K, V, S>
146-
where K: Encodable + Hash + Eq,
146+
where K: Encodable + Eq,
147147
V: Encodable,
148148
S: BuildHasher,
149149
{
@@ -180,7 +180,7 @@ impl<K, V, S> Decodable for HashMap<K, V, S>
180180
}
181181

182182
impl<T, S> Encodable for HashSet<T, S>
183-
where T: Encodable + Hash + Eq,
183+
where T: Encodable + Eq,
184184
S: BuildHasher,
185185
{
186186
fn encode<E: Encoder>(&self, s: &mut E) -> Result<(), E::Error> {

0 commit comments

Comments
 (0)