diff options
| author | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-10-20 15:54:53 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-10-21 20:59:18 +1100 |
| commit | ac6daed384d17abd31f84fc8205c21eee6a248be (patch) | |
| tree | 1b65f9ba48504a77ce640669baa10e8f8fb283c1 /src/librustc_data_structures | |
| parent | c3b3a861244f5e61d5912ba507e229d978ec1c1c (diff) | |
| download | rust-ac6daed384d17abd31f84fc8205c21eee6a248be.tar.gz rust-ac6daed384d17abd31f84fc8205c21eee6a248be.zip | |
Remove many unnecessary trait derivations.
Diffstat (limited to 'src/librustc_data_structures')
| -rw-r--r-- | src/librustc_data_structures/graph/implementation/mod.rs | 4 | ||||
| -rw-r--r-- | src/librustc_data_structures/stable_hasher.rs | 4 | ||||
| -rw-r--r-- | src/librustc_data_structures/sync.rs | 2 | ||||
| -rw-r--r-- | src/librustc_data_structures/thin_vec.rs | 2 | ||||
| -rw-r--r-- | src/librustc_data_structures/tiny_list.rs | 4 | ||||
| -rw-r--r-- | src/librustc_data_structures/transitive_relation.rs | 6 |
6 files changed, 11 insertions, 11 deletions
diff --git a/src/librustc_data_structures/graph/implementation/mod.rs b/src/librustc_data_structures/graph/implementation/mod.rs index c438a8558a7..9fdcea6df88 100644 --- a/src/librustc_data_structures/graph/implementation/mod.rs +++ b/src/librustc_data_structures/graph/implementation/mod.rs @@ -60,10 +60,10 @@ impl<N> SnapshotVecDelegate for Edge<N> { fn reverse(_: &mut Vec<Edge<N>>, _: ()) {} } -#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)] +#[derive(Copy, Clone, PartialEq, Debug)] pub struct NodeIndex(pub usize); -#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)] +#[derive(Copy, Clone, PartialEq, Debug)] pub struct EdgeIndex(pub usize); pub const INVALID_EDGE_INDEX: EdgeIndex = EdgeIndex(usize::MAX); diff --git a/src/librustc_data_structures/stable_hasher.rs b/src/librustc_data_structures/stable_hasher.rs index 78494401c0b..092208cfe1d 100644 --- a/src/librustc_data_structures/stable_hasher.rs +++ b/src/librustc_data_structures/stable_hasher.rs @@ -169,7 +169,7 @@ pub trait HashStable<CTX> { /// example, for DefId that can be converted to a DefPathHash. This is used for /// bringing maps into a predictable order before hashing them. pub trait ToStableHashKey<HCX> { - type KeyType: Ord + Clone + Sized + HashStable<HCX>; + type KeyType: Ord + Sized + HashStable<HCX>; fn to_stable_hash_key(&self, hcx: &HCX) -> Self::KeyType; } @@ -516,7 +516,7 @@ pub fn hash_stable_hashmap<HCX, K, V, R, SK, F>( where K: Eq, V: HashStable<HCX>, R: BuildHasher, - SK: HashStable<HCX> + Ord + Clone, + SK: HashStable<HCX> + Ord, F: Fn(&K, &HCX) -> SK, { let mut entries: Vec<_> = map.iter() diff --git a/src/librustc_data_structures/sync.rs b/src/librustc_data_structures/sync.rs index 9622c290039..f09474ff4d3 100644 --- a/src/librustc_data_structures/sync.rs +++ b/src/librustc_data_structures/sync.rs @@ -738,7 +738,7 @@ impl<T: Clone> Clone for RwLock<T> { /// A type which only allows its inner value to be used in one thread. /// It will panic if it is used on multiple threads. -#[derive(Copy, Clone, Hash, Debug, Eq, PartialEq)] +#[derive(Debug)] pub struct OneThread<T> { #[cfg(parallel_compiler)] thread: thread::ThreadId, diff --git a/src/librustc_data_structures/thin_vec.rs b/src/librustc_data_structures/thin_vec.rs index 93a8b7f525f..d97da489db8 100644 --- a/src/librustc_data_structures/thin_vec.rs +++ b/src/librustc_data_structures/thin_vec.rs @@ -3,7 +3,7 @@ use crate::stable_hasher::{StableHasher, HashStable}; /// A vector type optimized for cases where this size is usually 0 (cf. `SmallVector`). /// The `Option<Box<..>>` wrapping allows us to represent a zero sized vector with `None`, /// which uses only a single (null) pointer. -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] pub struct ThinVec<T>(Option<Box<Vec<T>>>); impl<T> ThinVec<T> { diff --git a/src/librustc_data_structures/tiny_list.rs b/src/librustc_data_structures/tiny_list.rs index ea771d9f20f..371f0f6fa0b 100644 --- a/src/librustc_data_structures/tiny_list.rs +++ b/src/librustc_data_structures/tiny_list.rs @@ -14,7 +14,7 @@ #[cfg(test)] mod tests; -#[derive(Clone, Hash, Debug, PartialEq)] +#[derive(Clone)] pub struct TinyList<T: PartialEq> { head: Option<Element<T>> } @@ -80,7 +80,7 @@ impl<T: PartialEq> TinyList<T> { } } -#[derive(Clone, Hash, Debug, PartialEq)] +#[derive(Clone)] struct Element<T: PartialEq> { data: T, next: Option<Box<Element<T>>>, diff --git a/src/librustc_data_structures/transitive_relation.rs b/src/librustc_data_structures/transitive_relation.rs index f0a9c3afc68..a3926c15551 100644 --- a/src/librustc_data_structures/transitive_relation.rs +++ b/src/librustc_data_structures/transitive_relation.rs @@ -11,7 +11,7 @@ use std::mem; mod tests; #[derive(Clone, Debug)] -pub struct TransitiveRelation<T: Clone + Debug + Eq + Hash> { +pub struct TransitiveRelation<T: Eq + Hash> { // List of elements. This is used to map from a T to a usize. elements: Vec<T>, @@ -35,7 +35,7 @@ pub struct TransitiveRelation<T: Clone + Debug + Eq + Hash> { } // HACK(eddyb) manual impl avoids `Default` bound on `T`. -impl<T: Clone + Debug + Eq + Hash> Default for TransitiveRelation<T> { +impl<T: Eq + Hash> Default for TransitiveRelation<T> { fn default() -> Self { TransitiveRelation { elements: Default::default(), @@ -46,7 +46,7 @@ impl<T: Clone + Debug + Eq + Hash> Default for TransitiveRelation<T> { } } -#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable, Debug)] +#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, RustcEncodable, RustcDecodable, Debug)] struct Index(usize); #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Debug)] |
