diff --git a/src/librustc/ich/impls_hir.rs b/src/librustc/ich/impls_hir.rs index d849c2d68576..066359bd4e03 100644 --- a/src/librustc/ich/impls_hir.rs +++ b/src/librustc/ich/impls_hir.rs @@ -9,7 +9,6 @@ use crate::ich::{StableHashingContext, NodeIdHashingMode, Fingerprint}; use rustc_data_structures::stable_hasher::{HashStable, ToStableHashKey, StableHasher}; use smallvec::SmallVec; use std::mem; -use syntax::ast; use syntax::attr; impl<'a> HashStable> for DefId { @@ -134,10 +133,6 @@ impl<'a> HashStable> for hir::Ty { } } -impl_stable_hash_for_spanned!(hir::BinOpKind); - -impl_stable_hash_for_spanned!(ast::Name); - impl<'a> HashStable> for hir::Expr { fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) { hcx.while_hashing_hir_bodies(true, |hcx| { @@ -155,8 +150,6 @@ impl<'a> HashStable> for hir::Expr { } } -impl_stable_hash_for_spanned!(usize); - impl<'a> HashStable> for hir::TraitItem { fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) { let hir::TraitItem { @@ -225,8 +218,6 @@ impl<'a> HashStable> for hir::VisibilityKind { } } -impl_stable_hash_for_spanned!(hir::VisibilityKind); - impl<'a> HashStable> for hir::Mod { fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) { let hir::Mod { @@ -254,9 +245,6 @@ impl<'a> HashStable> for hir::Mod { } } -impl_stable_hash_for_spanned!(hir::Variant); - - impl<'a> HashStable> for hir::Item { fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) { let hir::Item { diff --git a/src/librustc/ich/impls_syntax.rs b/src/librustc/ich/impls_syntax.rs index a30804c76e60..aae175e96473 100644 --- a/src/librustc/ich/impls_syntax.rs +++ b/src/librustc/ich/impls_syntax.rs @@ -18,8 +18,6 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; impl<'ctx> rustc_target::StableHashingContextLike for StableHashingContext<'ctx> {} -impl_stable_hash_for_spanned!(::syntax::ast::LitKind); - impl_stable_hash_for!(struct ::syntax::ast::Lifetime { id, ident }); impl<'a> HashStable> for [ast::Attribute] { diff --git a/src/librustc/macros.rs b/src/librustc/macros.rs index aae1c7a29927..59612a0ee5cf 100644 --- a/src/librustc/macros.rs +++ b/src/librustc/macros.rs @@ -166,23 +166,6 @@ macro_rules! impl_stable_hash_for { }; } -#[macro_export] -macro_rules! impl_stable_hash_for_spanned { - ($T:path) => ( - - impl HashStable> for ::syntax::source_map::Spanned<$T> - { - #[inline] - fn hash_stable(&self, - hcx: &mut StableHashingContext<'a>, - hasher: &mut StableHasher) { - self.node.hash_stable(hcx, hasher); - self.span.hash_stable(hcx, hasher); - } - } - ); -} - /////////////////////////////////////////////////////////////////////////// // Lift and TypeFoldable macros // diff --git a/src/libsyntax_pos/source_map.rs b/src/libsyntax_pos/source_map.rs index 77d9807225ec..b597fad080fa 100644 --- a/src/libsyntax_pos/source_map.rs +++ b/src/libsyntax_pos/source_map.rs @@ -39,7 +39,7 @@ pub fn original_sp(sp: Span, enclosing_sp: Span) -> Span { } } -#[derive(Clone, RustcEncodable, RustcDecodable, Debug, Copy)] +#[derive(Clone, RustcEncodable, RustcDecodable, Debug, Copy, HashStable_Generic)] pub struct Spanned { pub node: T, pub span: Span,