Retire impl_stable_hash_for_spanned.
This commit is contained in:
parent
e85c195174
commit
8c86a79947
4 changed files with 1 additions and 32 deletions
|
|
@ -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<StableHashingContext<'a>> for DefId {
|
||||
|
|
@ -134,10 +133,6 @@ impl<'a> HashStable<StableHashingContext<'a>> for hir::Ty {
|
|||
}
|
||||
}
|
||||
|
||||
impl_stable_hash_for_spanned!(hir::BinOpKind);
|
||||
|
||||
impl_stable_hash_for_spanned!(ast::Name);
|
||||
|
||||
impl<'a> HashStable<StableHashingContext<'a>> 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<StableHashingContext<'a>> for hir::Expr {
|
|||
}
|
||||
}
|
||||
|
||||
impl_stable_hash_for_spanned!(usize);
|
||||
|
||||
impl<'a> HashStable<StableHashingContext<'a>> for hir::TraitItem {
|
||||
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
|
||||
let hir::TraitItem {
|
||||
|
|
@ -225,8 +218,6 @@ impl<'a> HashStable<StableHashingContext<'a>> for hir::VisibilityKind {
|
|||
}
|
||||
}
|
||||
|
||||
impl_stable_hash_for_spanned!(hir::VisibilityKind);
|
||||
|
||||
impl<'a> HashStable<StableHashingContext<'a>> for hir::Mod {
|
||||
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
|
||||
let hir::Mod {
|
||||
|
|
@ -254,9 +245,6 @@ impl<'a> HashStable<StableHashingContext<'a>> for hir::Mod {
|
|||
}
|
||||
}
|
||||
|
||||
impl_stable_hash_for_spanned!(hir::Variant);
|
||||
|
||||
|
||||
impl<'a> HashStable<StableHashingContext<'a>> for hir::Item {
|
||||
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
|
||||
let hir::Item {
|
||||
|
|
|
|||
|
|
@ -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<StableHashingContext<'a>> for [ast::Attribute] {
|
||||
|
|
|
|||
|
|
@ -166,23 +166,6 @@ macro_rules! impl_stable_hash_for {
|
|||
};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! impl_stable_hash_for_spanned {
|
||||
($T:path) => (
|
||||
|
||||
impl HashStable<StableHashingContext<'a>> 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
|
||||
//
|
||||
|
|
|
|||
|
|
@ -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<T> {
|
||||
pub node: T,
|
||||
pub span: Span,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue