diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index bbd3b40e1be..465673082e5 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -1215,7 +1215,7 @@ impl UnOp { } /// A statement. -#[derive(RustcEncodable, RustcDecodable)] +#[derive(RustcEncodable, RustcDecodable, HashStable)] pub struct Stmt { pub hir_id: HirId, pub kind: StmtKind, diff --git a/src/librustc/ich/impls_hir.rs b/src/librustc/ich/impls_hir.rs index c0255e5b8a4..816e93698bc 100644 --- a/src/librustc/ich/impls_hir.rs +++ b/src/librustc/ich/impls_hir.rs @@ -140,13 +140,6 @@ impl<'a> HashStable> for hir::Ty { impl_stable_hash_for_spanned!(hir::BinOpKind); -impl_stable_hash_for!(struct hir::Stmt { - hir_id, - kind, - span, -}); - - impl_stable_hash_for_spanned!(ast::Name); impl<'a> HashStable> for hir::Expr { diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index 541121928c7..b115b5a6991 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -1589,13 +1589,12 @@ rustc_index::newtype_index! { /// declared, but a type name in a non-zero universe is a placeholder /// type -- an idealized representative of "types in general" that we /// use for checking generic functions. + #[derive(HashStable)] pub struct UniverseIndex { DEBUG_FORMAT = "U{}", } } -impl_stable_hash_for!(struct UniverseIndex { private }); - impl UniverseIndex { pub const ROOT: UniverseIndex = UniverseIndex::from_u32_const(0); @@ -1839,7 +1838,7 @@ bitflags! { } /// Definition of a variant -- a struct's fields or a enum variant. -#[derive(Debug)] +#[derive(Debug, HashStable)] pub struct VariantDef { /// `DefId` that identifies the variant itself. /// If this variant belongs to a struct or union, then this is a copy of its `DefId`. @@ -1848,6 +1847,7 @@ pub struct VariantDef { /// If this variant is a struct variant, then this is `None`. pub ctor_def_id: Option, /// Variant or struct name. + #[stable_hasher(project = name)] pub ident: Ident, /// Discriminant of this variant. pub discr: VariantDiscr, @@ -1927,17 +1927,6 @@ impl<'tcx> VariantDef { } } -impl_stable_hash_for!(struct VariantDef { - def_id, - ctor_def_id, - ident -> (ident.name), - discr, - fields, - ctor_kind, - flags, - recovered -}); - #[derive(Copy, Clone, Debug, PartialEq, Eq, RustcEncodable, RustcDecodable, HashStable)] pub enum VariantDiscr { /// Explicit value for this variant, i.e., `X = 123`. @@ -2061,7 +2050,7 @@ impl Into for AdtKind { } bitflags! { - #[derive(RustcEncodable, RustcDecodable, Default)] + #[derive(RustcEncodable, RustcDecodable, Default, HashStable)] pub struct ReprFlags: u8 { const IS_C = 1 << 0; const IS_SIMD = 1 << 1; @@ -2076,10 +2065,6 @@ bitflags! { } } -impl_stable_hash_for!(struct ReprFlags { - bits -}); - /// Represents the repr options provided by the user, #[derive(Copy, Clone, Debug, Eq, PartialEq, RustcEncodable, RustcDecodable, Default, HashStable)] diff --git a/src/librustc/ty/sty.rs b/src/librustc/ty/sty.rs index 858f9d7e34c..07258717cd9 100644 --- a/src/librustc/ty/sty.rs +++ b/src/librustc/ty/sty.rs @@ -1204,6 +1204,7 @@ rustc_index::newtype_index! { /// is the outer fn. /// /// [dbi]: http://en.wikipedia.org/wiki/De_Bruijn_index + #[derive(HashStable)] pub struct DebruijnIndex { DEBUG_FORMAT = "DebruijnIndex({})", const INNERMOST = 0, @@ -1517,8 +1518,6 @@ impl DebruijnIndex { } } -impl_stable_hash_for!(struct DebruijnIndex { private }); - /// Region utilities impl RegionKind { /// Is this region named by the user?