Skip to content

Commit cb46c35

Browse files
committed
Use multiple derive clauses.
1 parent 7214b9a commit cb46c35

File tree

5 files changed

+34
-34
lines changed

5 files changed

+34
-34
lines changed

src/librustc/infer/canonical/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ mod substitute;
4444
/// A "canonicalized" type `V` is one where all free inference
4545
/// variables have been rewritten to "canonical vars". These are
4646
/// numbered starting from 0 in order of first appearance.
47-
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, RustcDecodable, RustcEncodable,
48-
HashStable, TypeFoldable)]
47+
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, RustcDecodable, RustcEncodable)]
48+
#[derive(HashStable, TypeFoldable)]
4949
pub struct Canonical<'tcx, V> {
5050
pub max_universe: ty::UniverseIndex,
5151
pub variables: CanonicalVarInfos<'tcx>,
@@ -65,8 +65,8 @@ impl<'tcx> UseSpecializedDecodable for CanonicalVarInfos<'tcx> {}
6565
/// vectors with the original values that were replaced by canonical
6666
/// variables. You will need to supply it later to instantiate the
6767
/// canonicalized query response.
68-
#[derive(Clone, Debug, PartialEq, Eq, Hash, RustcDecodable, RustcEncodable,
69-
HashStable, TypeFoldable)]
68+
#[derive(Clone, Debug, PartialEq, Eq, Hash, RustcDecodable, RustcEncodable)]
69+
#[derive(HashStable, TypeFoldable)]
7070
pub struct CanonicalVarValues<'tcx> {
7171
pub var_values: IndexVec<BoundVar, GenericArg<'tcx>>,
7272
}

src/librustc/ty/context.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,8 @@ pub struct ResolvedOpaqueTy<'tcx> {
307307
///
308308
/// Here, we would store the type `T`, the span of the value `x`, and the "scope-span" for
309309
/// the scope that contains `x`.
310-
#[derive(RustcEncodable, RustcDecodable, Clone, Debug, Eq, Hash, HashStable, PartialEq,
311-
TypeFoldable)]
310+
#[derive(RustcEncodable, RustcDecodable, Clone, Debug, Eq, Hash, PartialEq)]
311+
#[derive(HashStable, TypeFoldable)]
312312
pub struct GeneratorInteriorTypeCause<'tcx> {
313313
/// Type of the captured binding.
314314
pub ty: Ty<'tcx>,

src/librustc/ty/mod.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -1097,8 +1097,8 @@ impl<'tcx> GenericPredicates<'tcx> {
10971097
}
10981098
}
10991099

1100-
#[derive(Clone, Copy, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable,
1101-
HashStable, TypeFoldable)]
1100+
#[derive(Clone, Copy, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
1101+
#[derive(HashStable, TypeFoldable)]
11021102
pub enum Predicate<'tcx> {
11031103
/// Corresponds to `where Foo: Bar<A, B, C>`. `Foo` here would be
11041104
/// the `Self` type of the trait reference and `A`, `B`, and `C`
@@ -1248,8 +1248,8 @@ impl<'tcx> Predicate<'tcx> {
12481248
}
12491249
}
12501250

1251-
#[derive(Clone, Copy, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable,
1252-
HashStable, TypeFoldable)]
1251+
#[derive(Clone, Copy, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
1252+
#[derive(HashStable, TypeFoldable)]
12531253
pub struct TraitPredicate<'tcx> {
12541254
pub trait_ref: TraitRef<'tcx>
12551255
}
@@ -1277,17 +1277,17 @@ impl<'tcx> PolyTraitPredicate<'tcx> {
12771277
}
12781278
}
12791279

1280-
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord,
1281-
Hash, Debug, RustcEncodable, RustcDecodable, HashStable, TypeFoldable)]
1280+
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, RustcEncodable, RustcDecodable)]
1281+
#[derive(HashStable, TypeFoldable)]
12821282
pub struct OutlivesPredicate<A, B>(pub A, pub B); // `A: B`
12831283
pub type PolyOutlivesPredicate<A, B> = ty::Binder<OutlivesPredicate<A, B>>;
12841284
pub type RegionOutlivesPredicate<'tcx> = OutlivesPredicate<ty::Region<'tcx>, ty::Region<'tcx>>;
12851285
pub type TypeOutlivesPredicate<'tcx> = OutlivesPredicate<Ty<'tcx>, ty::Region<'tcx>>;
12861286
pub type PolyRegionOutlivesPredicate<'tcx> = ty::Binder<RegionOutlivesPredicate<'tcx>>;
12871287
pub type PolyTypeOutlivesPredicate<'tcx> = ty::Binder<TypeOutlivesPredicate<'tcx>>;
12881288

1289-
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, RustcEncodable, RustcDecodable,
1290-
HashStable, TypeFoldable)]
1289+
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, RustcEncodable, RustcDecodable)]
1290+
#[derive(HashStable, TypeFoldable)]
12911291
pub struct SubtypePredicate<'tcx> {
12921292
pub a_is_expected: bool,
12931293
pub a: Ty<'tcx>,
@@ -1307,8 +1307,8 @@ pub type PolySubtypePredicate<'tcx> = ty::Binder<SubtypePredicate<'tcx>>;
13071307
/// equality between arbitrary types. Processing an instance of
13081308
/// Form #2 eventually yields one of these `ProjectionPredicate`
13091309
/// instances to normalize the LHS.
1310-
#[derive(Copy, Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable,
1311-
HashStable, TypeFoldable)]
1310+
#[derive(Copy, Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
1311+
#[derive(HashStable, TypeFoldable)]
13121312
pub struct ProjectionPredicate<'tcx> {
13131313
pub projection_ty: ProjectionTy<'tcx>,
13141314
pub ty: Ty<'tcx>,

src/librustc/ty/sty.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ use syntax::symbol::{kw, Symbol};
2929
use self::InferTy::*;
3030
use self::TyKind::*;
3131

32-
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord,
33-
Hash, Debug, RustcEncodable, RustcDecodable, HashStable, TypeFoldable)]
32+
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, RustcEncodable, RustcDecodable)]
33+
#[derive(HashStable, TypeFoldable)]
3434
pub struct TypeAndMut<'tcx> {
3535
pub ty: Ty<'tcx>,
3636
pub mutbl: hir::Mutability,
@@ -591,8 +591,8 @@ impl<'tcx> UpvarSubsts<'tcx> {
591591
}
592592
}
593593

594-
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd, Ord, Eq, Hash,
595-
RustcEncodable, RustcDecodable, HashStable, TypeFoldable)]
594+
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd, Ord, Eq, Hash, RustcEncodable, RustcDecodable)]
595+
#[derive(HashStable, TypeFoldable)]
596596
pub enum ExistentialPredicate<'tcx> {
597597
/// E.g., `Iterator`.
598598
Trait(ExistentialTraitRef<'tcx>),
@@ -742,8 +742,8 @@ impl<'tcx> Binder<&'tcx List<ExistentialPredicate<'tcx>>> {
742742
/// Note that a `TraitRef` introduces a level of region binding, to
743743
/// account for higher-ranked trait bounds like `T: for<'a> Foo<&'a U>`
744744
/// or higher-ranked object types.
745-
#[derive(Copy, Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable,
746-
HashStable, TypeFoldable)]
745+
#[derive(Copy, Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
746+
#[derive(HashStable, TypeFoldable)]
747747
pub struct TraitRef<'tcx> {
748748
pub def_id: DefId,
749749
pub substs: SubstsRef<'tcx>,
@@ -814,8 +814,8 @@ impl<'tcx> PolyTraitRef<'tcx> {
814814
///
815815
/// The substitutions don't include the erased `Self`, only trait
816816
/// type and lifetime parameters (`[X, Y]` and `['a, 'b]` above).
817-
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
818-
RustcEncodable, RustcDecodable, HashStable, TypeFoldable)]
817+
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable)]
818+
#[derive(HashStable, TypeFoldable)]
819819
pub struct ExistentialTraitRef<'tcx> {
820820
pub def_id: DefId,
821821
pub substs: SubstsRef<'tcx>,
@@ -986,8 +986,8 @@ impl<T> Binder<T> {
986986

987987
/// Represents the projection of an associated type. In explicit UFCS
988988
/// form this would be written `<T as Trait<..>>::N`.
989-
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord,
990-
Hash, Debug, RustcEncodable, RustcDecodable, HashStable, TypeFoldable)]
989+
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, RustcEncodable, RustcDecodable)]
990+
#[derive(HashStable, TypeFoldable)]
991991
pub struct ProjectionTy<'tcx> {
992992
/// The parameters of the associated item.
993993
pub substs: SubstsRef<'tcx>,
@@ -1057,8 +1057,8 @@ impl<'tcx> PolyGenSig<'tcx> {
10571057
/// - `inputs`: is the list of arguments and their modes.
10581058
/// - `output`: is the return type.
10591059
/// - `c_variadic`: indicates whether this is a C-variadic function.
1060-
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord,
1061-
Hash, RustcEncodable, RustcDecodable, HashStable, TypeFoldable)]
1060+
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable)]
1061+
#[derive(HashStable, TypeFoldable)]
10621062
pub struct FnSig<'tcx> {
10631063
pub inputs_and_output: &'tcx List<Ty<'tcx>>,
10641064
pub c_variadic: bool,
@@ -1404,8 +1404,8 @@ impl From<BoundVar> for BoundTy {
14041404
}
14051405

14061406
/// A `ProjectionPredicate` for an `ExistentialTraitRef`.
1407-
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash,
1408-
Debug, RustcEncodable, RustcDecodable, HashStable, TypeFoldable)]
1407+
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, RustcEncodable, RustcDecodable)]
1408+
#[derive(HashStable, TypeFoldable)]
14091409
pub struct ExistentialProjection<'tcx> {
14101410
pub item_def_id: DefId,
14111411
pub substs: SubstsRef<'tcx>,

src/librustc/ty/subst.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -731,8 +731,8 @@ pub type CanonicalUserSubsts<'tcx> = Canonical<'tcx, UserSubsts<'tcx>>;
731731

732732
/// Stores the user-given substs to reach some fully qualified path
733733
/// (e.g., `<T>::Item` or `<T as Trait>::Item`).
734-
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable,
735-
HashStable, TypeFoldable)]
734+
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
735+
#[derive(HashStable, TypeFoldable)]
736736
pub struct UserSubsts<'tcx> {
737737
/// The substitutions for the item as given by the user.
738738
pub substs: SubstsRef<'tcx>,
@@ -766,8 +766,8 @@ BraceStructLiftImpl! {
766766
/// the impl (with the substs from `UserSubsts`) and apply those to
767767
/// the self type, giving `Foo<?A>`. Finally, we unify that with
768768
/// the self type here, which contains `?A` to be `&'static u32`
769-
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable,
770-
HashStable, TypeFoldable)]
769+
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
770+
#[derive(HashStable, TypeFoldable)]
771771
pub struct UserSelfTy<'tcx> {
772772
pub impl_def_id: DefId,
773773
pub self_ty: Ty<'tcx>,

0 commit comments

Comments
 (0)