Skip to content

Commit ac6daed

Browse files
committed
Remove many unnecessary trait derivations.
1 parent c3b3a86 commit ac6daed

File tree

49 files changed

+89
-103
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+89
-103
lines changed

src/librustc/dep_graph/graph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl DepNodeIndex {
3535
pub const INVALID: DepNodeIndex = DepNodeIndex::MAX;
3636
}
3737

38-
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
38+
#[derive(PartialEq)]
3939
pub enum DepNodeColor {
4040
Red,
4141
Green(DepNodeIndex)

src/librustc/hir/map/definitions.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,6 @@ macro_rules! define_global_metadata_kind {
599599
(pub enum GlobalMetaDataKind {
600600
$($variant:ident),*
601601
}) => (
602-
#[derive(Clone, Copy, Debug, Hash, RustcEncodable, RustcDecodable)]
603602
pub enum GlobalMetaDataKind {
604603
$($variant),*
605604
}

src/librustc/hir/mod.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ impl Mutability {
10771077
}
10781078
}
10791079

1080-
#[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, Hash, HashStable)]
1080+
#[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, HashStable)]
10811081
pub enum BinOpKind {
10821082
/// The `+` operator (addition).
10831083
Add,
@@ -1211,7 +1211,7 @@ impl Into<ast::BinOpKind> for BinOpKind {
12111211

12121212
pub type BinOp = Spanned<BinOpKind>;
12131213

1214-
#[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, Hash, HashStable)]
1214+
#[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, HashStable)]
12151215
pub enum UnOp {
12161216
/// The `*` operator (deferencing).
12171217
UnDeref,
@@ -1388,8 +1388,7 @@ impl Body {
13881388
}
13891389

13901390
/// The type of source expression that caused this generator to be created.
1391-
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, HashStable,
1392-
RustcEncodable, RustcDecodable, Hash, Debug, Copy)]
1391+
#[derive(Clone, PartialEq, Eq, HashStable, RustcEncodable, RustcDecodable, Debug, Copy)]
13931392
pub enum GeneratorKind {
13941393
/// An explicit `async` block or the body of an async function.
13951394
Async(AsyncGeneratorKind),
@@ -1412,8 +1411,7 @@ impl fmt::Display for GeneratorKind {
14121411
///
14131412
/// This helps error messages but is also used to drive coercions in
14141413
/// type-checking (see #60424).
1415-
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, HashStable,
1416-
RustcEncodable, RustcDecodable, Hash, Debug, Copy)]
1414+
#[derive(Clone, PartialEq, Eq, HashStable, RustcEncodable, RustcDecodable, Debug, Copy)]
14171415
pub enum AsyncGeneratorKind {
14181416
/// An explicit `async` block written by the user.
14191417
Block,

src/librustc/hir/ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_serialize::{Encodable, Decodable, Encoder, Decoder};
1111

1212
use rustc_data_structures::stable_hasher::{StableHasher, HashStable};
1313
/// An owned smart pointer.
14-
#[derive(Hash, PartialEq, Eq)]
14+
#[derive(PartialEq, Eq)]
1515
pub struct P<T: ?Sized> {
1616
ptr: Box<T>
1717
}

src/librustc/infer/canonical/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub struct CanonicalVarValues<'tcx> {
7373
/// various parts of it with canonical variables. This struct stores
7474
/// those replaced bits to remember for when we process the query
7575
/// result.
76-
#[derive(Clone, Debug, PartialEq, Eq, Hash, RustcDecodable, RustcEncodable)]
76+
#[derive(Clone, Debug)]
7777
pub struct OriginalQueryValues<'tcx> {
7878
/// Map from the universes that appear in the query to the
7979
/// universes in the caller context. For the time being, we only

src/librustc/infer/combine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub struct CombineFields<'infcx, 'tcx> {
5353
pub obligations: PredicateObligations<'tcx>,
5454
}
5555

56-
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
56+
#[derive(Copy, Clone, Debug)]
5757
pub enum RelationDir {
5858
SubtypeOf, SupertypeOf, EqTo
5959
}

src/librustc/infer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ pub enum RegionVariableOrigin {
407407
NLL(NLLRegionVariableOrigin),
408408
}
409409

410-
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
410+
#[derive(Copy, Clone, Debug)]
411411
pub enum NLLRegionVariableOrigin {
412412
/// During NLL region processing, we create variables for free
413413
/// regions that we encounter in the function signature and

src/librustc/infer/nll_relate/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use crate::mir::interpret::ConstValue;
3232
use rustc_data_structures::fx::FxHashMap;
3333
use std::fmt::Debug;
3434

35-
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
35+
#[derive(PartialEq)]
3636
pub enum NormalizationStrategy {
3737
Lazy,
3838
Eager,

src/librustc/infer/region_constraints/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ pub struct RegionConstraintData<'tcx> {
116116
}
117117

118118
/// Represents a constraint that influences the inference process.
119-
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, PartialOrd, Ord)]
119+
#[derive(Clone, Copy, PartialEq, Eq, Debug, PartialOrd, Ord)]
120120
pub enum Constraint<'tcx> {
121121
/// A region variable is a subregion of another.
122122
VarSubVar(RegionVid, RegionVid),

src/librustc/middle/cstore.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ pub struct NativeLibrary {
117117
pub wasm_import_module: Option<Symbol>,
118118
}
119119

120-
#[derive(Clone, Hash, RustcEncodable, RustcDecodable, HashStable)]
120+
#[derive(Clone, RustcEncodable, RustcDecodable, HashStable)]
121121
pub struct ForeignModule {
122122
pub foreign_items: Vec<DefId>,
123123
pub def_id: DefId,

0 commit comments

Comments
 (0)