From 4d1a30c92b50c5965ed26449758fca81bee15747 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Wed, 21 Mar 2018 01:58:25 +0300 Subject: [PATCH 1/4] Remove most of `PartialEq` impls from AST and HIR structures --- src/librustc/hir/def_id.rs | 8 +- src/librustc/hir/intravisit.rs | 4 +- src/librustc/hir/lowering.rs | 4 +- src/librustc/hir/map/definitions.rs | 11 +- src/librustc/hir/mod.rs | 169 +++++++------- src/librustc/hir/print.rs | 8 +- .../nice_region_error/different_lifetimes.rs | 2 +- src/librustc/ty/mod.rs | 2 +- src/librustc_lint/builtin.rs | 4 +- src/librustc_passes/ast_validation.rs | 28 +-- src/librustc_resolve/check_unused.rs | 2 +- src/librustc_resolve/lib.rs | 2 +- src/librustc_save_analysis/dump_visitor.rs | 6 +- src/librustc_typeck/check/method/probe.rs | 2 +- src/librustdoc/clean/mod.rs | 18 +- src/libserialize/collection_impls.rs | 4 +- src/libsyntax/ast.rs | 215 ++++++++++-------- src/libsyntax/ext/base.rs | 2 +- src/libsyntax/ext/tt/quoted.rs | 8 +- src/libsyntax/feature_gate.rs | 14 +- src/libsyntax/parse/attr.rs | 4 +- src/libsyntax/parse/lexer/mod.rs | 2 +- src/libsyntax/parse/parser.rs | 10 +- src/libsyntax/parse/token.rs | 10 +- src/libsyntax/print/pprust.rs | 4 +- src/libsyntax/ptr.rs | 2 +- src/libsyntax/test.rs | 3 +- src/libsyntax/tokenstream.rs | 4 +- src/libsyntax/util/parser.rs | 20 +- src/libsyntax/visit.rs | 2 +- src/libsyntax_ext/deriving/generic/mod.rs | 8 +- src/libsyntax_ext/deriving/generic/ty.rs | 9 +- src/libsyntax_ext/format_foreign.rs | 8 +- src/libsyntax_ext/proc_macro_registrar.rs | 11 +- src/libsyntax_pos/edition.rs | 2 +- 35 files changed, 315 insertions(+), 297 deletions(-) diff --git a/src/librustc/hir/def_id.rs b/src/librustc/hir/def_id.rs index 34b3aa53d6bcf..7acfe6839540b 100644 --- a/src/librustc/hir/def_id.rs +++ b/src/librustc/hir/def_id.rs @@ -81,7 +81,7 @@ impl serialize::UseSpecializedDecodable for CrateNum {} /// Since the DefIndex is mostly treated as an opaque ID, you probably /// don't have to care about these address spaces. -#[derive(Clone, Eq, Ord, PartialOrd, PartialEq, Hash, Copy)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Copy)] pub struct DefIndex(u32); /// The crate root is always assigned index 0 by the AST Map code, @@ -150,7 +150,7 @@ impl DefIndex { impl serialize::UseSpecializedEncodable for DefIndex {} impl serialize::UseSpecializedDecodable for DefIndex {} -#[derive(Copy, Clone, Eq, PartialEq, Hash)] +#[derive(Copy, Clone, Hash)] pub enum DefIndexAddressSpace { Low = 0, High = 1, @@ -165,7 +165,7 @@ impl DefIndexAddressSpace { /// A DefId identifies a particular *definition*, by combining a crate /// index and a def index. -#[derive(Clone, Eq, Ord, PartialOrd, PartialEq, Hash, Copy)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Copy)] pub struct DefId { pub krate: CrateNum, pub index: DefIndex, @@ -216,7 +216,7 @@ impl serialize::UseSpecializedDecodable for DefId {} /// few cases where we know that only DefIds from the local crate are expected /// and a DefId from a different crate would signify a bug somewhere. This /// is when LocalDefId comes in handy. -#[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[derive(Clone, Copy, PartialEq, Eq, Hash)] pub struct LocalDefId(DefIndex); impl LocalDefId { diff --git a/src/librustc/hir/intravisit.rs b/src/librustc/hir/intravisit.rs index a7ed854d01649..e2c0020db2ff3 100644 --- a/src/librustc/hir/intravisit.rs +++ b/src/librustc/hir/intravisit.rs @@ -51,7 +51,7 @@ use super::itemlikevisit::DeepVisitor; use std::cmp; use std::u32; -#[derive(Copy, Clone, PartialEq, Eq)] +#[derive(Copy, Clone)] pub enum FnKind<'a> { /// #[xxx] pub async/const/extern "Abi" fn foo() ItemFn(Name, &'a Generics, FnHeader, &'a Visibility, &'a [Attribute]), @@ -1115,7 +1115,7 @@ pub fn walk_defaultness<'v, V: Visitor<'v>>(_: &mut V, _: &'v Defaultness) { // would be to walk it. } -#[derive(Copy, Clone, RustcEncodable, RustcDecodable, Debug, PartialEq, Eq)] +#[derive(Copy, Clone, RustcEncodable, RustcDecodable, Debug)] pub struct IdRange { pub min: NodeId, pub max: NodeId, diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index 7dd7954c8f439..cb53f963d41f1 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -238,7 +238,7 @@ pub fn lower_crate( }.lower_crate(krate) } -#[derive(Copy, Clone, PartialEq, Eq)] +#[derive(Copy, Clone, PartialEq)] enum ParamMode { /// Any path in a type context. Explicit, @@ -1927,7 +1927,7 @@ impl<'a> LoweringContext<'a> { variadic: decl.variadic, has_implicit_self: decl.inputs.get(0).map_or(false, |arg| match arg.ty.node { TyKind::ImplicitSelf => true, - TyKind::Rptr(_, ref mt) => mt.ty.node == TyKind::ImplicitSelf, + TyKind::Rptr(_, ref mt) => mt.ty.node.is_implicit_self(), _ => false, }), }) diff --git a/src/librustc/hir/map/definitions.rs b/src/librustc/hir/map/definitions.rs index 49a4a1b78a1a8..9b1bb3310f2fd 100644 --- a/src/librustc/hir/map/definitions.rs +++ b/src/librustc/hir/map/definitions.rs @@ -171,7 +171,7 @@ pub struct Definitions { /// A unique identifier that we can use to lookup a definition /// precisely. It combines the index of the definition's parent (if /// any) with a `DisambiguatedDefPathData`. -#[derive(Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)] +#[derive(Clone, PartialEq, Debug, Hash, RustcEncodable, RustcDecodable)] pub struct DefKey { /// Parent path. pub parent: Option, @@ -223,13 +223,13 @@ impl DefKey { /// between them. This introduces some artificial ordering dependency /// but means that if you have (e.g.) two impls for the same type in /// the same module, they do get distinct def-ids. -#[derive(Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)] +#[derive(Clone, PartialEq, Debug, Hash, RustcEncodable, RustcDecodable)] pub struct DisambiguatedDefPathData { pub data: DefPathData, pub disambiguator: u32 } -#[derive(Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)] +#[derive(Clone, Debug, Hash, RustcEncodable, RustcDecodable)] pub struct DefPath { /// the path leading from the crate root to the item pub data: Vec, @@ -311,7 +311,7 @@ impl DefPath { } } -#[derive(Clone, Debug, Eq, PartialEq, Hash, RustcEncodable, RustcDecodable)] +#[derive(Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)] pub enum DefPathData { // Root: these should only be used for the root nodes, because // they are treated specially by the `def_path` function. @@ -668,8 +668,7 @@ macro_rules! define_global_metadata_kind { (pub enum GlobalMetaDataKind { $($variant:ident),* }) => ( - #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, - RustcEncodable, RustcDecodable)] + #[derive(Clone, Copy, Debug, Hash, RustcEncodable, RustcDecodable)] pub enum GlobalMetaDataKind { $($variant),* } diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index bae443bfc5824..e98e9b1760351 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -89,7 +89,7 @@ pub mod svh; /// the local_id part of the HirId changing, which is a very useful property in /// incremental compilation where we have to persist things through changes to /// the code base. -#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Debug)] +#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] pub struct HirId { pub owner: DefIndex, pub local_id: ItemLocalId, @@ -138,7 +138,7 @@ impl serialize::UseSpecializedDecodable for HirId { /// integers starting at zero, so a mapping that maps all or most nodes within /// an "item-like" to something else can be implement by a `Vec` instead of a /// tree or hash map. -#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Debug, +#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, RustcEncodable, RustcDecodable)] pub struct ItemLocalId(pub u32); @@ -172,7 +172,7 @@ pub const DUMMY_HIR_ID: HirId = HirId { pub const DUMMY_ITEM_LOCAL_ID: ItemLocalId = ItemLocalId(!0); -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Copy)] pub struct Label { pub ident: Ident, } @@ -183,7 +183,7 @@ impl fmt::Debug for Label { } } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Copy)] pub struct Lifetime { pub id: NodeId, pub span: Span, @@ -312,7 +312,7 @@ impl Lifetime { /// A "Path" is essentially Rust's notion of a name; for instance: /// `std::cmp::PartialEq`. It's represented as a sequence of identifiers, /// along with a bunch of supporting information. -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash)] pub struct Path { pub span: Span, /// The definition that the path resolved to. @@ -341,7 +341,7 @@ impl fmt::Display for Path { /// A segment of a path: an identifier, an optional lifetime, and a set of /// types. -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct PathSegment { /// The identifier portion of this path segment. pub ident: Ident, @@ -396,7 +396,7 @@ impl PathSegment { } } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum GenericArg { Lifetime(Lifetime), Type(Ty), @@ -411,7 +411,7 @@ impl GenericArg { } } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct GenericArgs { /// The generic arguments for this path segment. pub args: HirVec, @@ -467,7 +467,7 @@ pub enum TraitBoundModifier { /// typeck::collect::compute_bounds matches these against /// the "special" built-in traits (see middle::lang_items) and /// detects Copy, Send and Sync. -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum GenericBound { Trait(PolyTraitRef, TraitBoundModifier), Outlives(Lifetime), @@ -484,7 +484,7 @@ impl GenericBound { pub type GenericBounds = HirVec; -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum GenericParamKind { /// A lifetime definition, eg `'a: 'b + 'c + 'd`. Lifetime { @@ -499,7 +499,7 @@ pub enum GenericParamKind { } } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct GenericParam { pub id: NodeId, pub name: ParamName, @@ -518,7 +518,7 @@ pub struct GenericParamCount { /// Represents lifetimes and type parameters attached to a declaration /// of a function, enum, trait, etc. -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct Generics { pub params: HirVec, pub where_clause: WhereClause, @@ -568,13 +568,13 @@ impl Generics { /// Synthetic Type Parameters are converted to an other form during lowering, this allows /// to track the original form they had. Useful for error messages. -#[derive(Copy, Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum SyntheticTyParamKind { ImplTrait } /// A `where` clause in a definition -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct WhereClause { pub id: NodeId, pub predicates: HirVec, @@ -593,7 +593,7 @@ impl WhereClause { } /// A single predicate in a `where` clause -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum WherePredicate { /// A type binding, eg `for<'c> Foo: Send+Clone+'c` BoundPredicate(WhereBoundPredicate), @@ -614,7 +614,7 @@ impl WherePredicate { } /// A type bound, eg `for<'c> Foo: Send+Clone+'c` -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct WhereBoundPredicate { pub span: Span, /// Any generics from a `for` binding @@ -626,7 +626,7 @@ pub struct WhereBoundPredicate { } /// A lifetime predicate, e.g. `'a: 'b+'c` -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct WhereRegionPredicate { pub span: Span, pub lifetime: Lifetime, @@ -634,7 +634,7 @@ pub struct WhereRegionPredicate { } /// An equality predicate (unsupported), e.g. `T=int` -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct WhereEqPredicate { pub id: NodeId, pub span: Span, @@ -650,7 +650,7 @@ pub type CrateConfig = HirVec>; /// For more details, see the [rustc guide]. /// /// [rustc guide]: https://rust-lang-nursery.github.io/rustc-guide/hir.html -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] pub struct Crate { pub module: Mod, pub attrs: HirVec, @@ -748,7 +748,7 @@ impl Crate { /// A macro definition, in this crate or imported from another. /// /// Not parsed directly, but created on macro import or `macro_rules!` expansion. -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct MacroDef { pub name: Name, pub vis: Visibility, @@ -759,7 +759,7 @@ pub struct MacroDef { pub legacy: bool, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct Block { /// Statements in a block pub stmts: HirVec, @@ -782,7 +782,7 @@ pub struct Block { pub recovered: bool, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash)] pub struct Pat { pub id: NodeId, pub hir_id: HirId, @@ -844,7 +844,7 @@ impl Pat { /// Patterns like the fields of Foo `{ x, ref y, ref mut z }` /// are treated the same as` x: x, y: ref y, z: ref mut z`, /// except is_shorthand is true -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct FieldPat { pub id: NodeId, /// The identifier for the field @@ -857,7 +857,7 @@ pub struct FieldPat { /// Explicit binding annotations given in the HIR for a binding. Note /// that this is not the final binding *mode* that we infer after type /// inference. -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] +#[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum BindingAnnotation { /// No binding annotation given: this means that the final binding mode /// will depend on whether we have skipped through a `&` reference @@ -878,13 +878,13 @@ pub enum BindingAnnotation { RefMut, } -#[derive(Copy, Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum RangeEnd { Included, Excluded, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum PatKind { /// Represents a wildcard pattern (`_`) Wild, @@ -940,7 +940,7 @@ impl Mutability { } } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] +#[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum BinOp_ { /// The `+` operator (addition) BiAdd, @@ -1069,7 +1069,7 @@ impl Into for BinOp_ { pub type BinOp = Spanned; -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] +#[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum UnOp { /// The `*` operator for dereferencing UnDeref, @@ -1111,7 +1111,7 @@ impl fmt::Debug for Stmt_ { } } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash)] pub enum Stmt_ { /// Could be an item or a local (let) binding: StmtDecl(P, NodeId), @@ -1142,7 +1142,7 @@ impl Stmt_ { } /// Local represents a `let` statement, e.g., `let : = ;` -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct Local { pub pat: P, pub ty: Option>, @@ -1157,7 +1157,7 @@ pub struct Local { pub type Decl = Spanned; -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum Decl_ { /// A local (let) binding: DeclLocal(P), @@ -1182,7 +1182,7 @@ impl Decl_ { } /// represents one arm of a 'match' -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct Arm { pub attrs: HirVec, pub pats: HirVec>, @@ -1190,7 +1190,7 @@ pub struct Arm { pub body: P, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct Field { pub id: NodeId, pub ident: Ident, @@ -1199,7 +1199,7 @@ pub struct Field { pub is_shorthand: bool, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] +#[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum BlockCheckMode { DefaultBlock, UnsafeBlock(UnsafeSource), @@ -1207,7 +1207,7 @@ pub enum BlockCheckMode { PopUnsafeBlock(UnsafeSource), } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] +#[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum UnsafeSource { CompilerGenerated, UserProvided, @@ -1239,7 +1239,7 @@ pub struct BodyId { /// /// All bodies have an **owner**, which can be accessed via the HIR /// map using `body_owner_def_id()`. -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct Body { pub arguments: HirVec, pub value: Expr, @@ -1279,7 +1279,7 @@ pub struct AnonConst { } /// An expression -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash)] pub struct Expr { pub id: NodeId, pub span: Span, @@ -1330,7 +1330,7 @@ impl fmt::Debug for Expr { } } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum Expr_ { /// A `box x` expression. ExprBox(P), @@ -1432,7 +1432,7 @@ pub enum Expr_ { } /// Optionally `Self`-qualified value/type path or associated extension. -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum QPath { /// Path to a definition, optionally "fully-qualified" with a `Self` /// type, if the path points to an associated item in a trait. @@ -1452,7 +1452,7 @@ pub enum QPath { } /// Hints at the original code for a let statement -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum LocalSource { /// A `match _ { .. }` Normal, @@ -1479,7 +1479,7 @@ pub enum MatchSource { } /// The loop type that yielded an ExprLoop -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] +#[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum LoopSource { /// A `loop { .. }` loop Loop, @@ -1489,7 +1489,7 @@ pub enum LoopSource { ForLoop, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] +#[derive(Clone, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum LoopIdError { OutsideLoopScope, UnlabeledCfInWhileCondition, @@ -1507,7 +1507,6 @@ impl fmt::Display for LoopIdError { } } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub struct Destination { // This is `Some(_)` iff there is an explicit user-specified `label pub label: Option