Skip to content

Commit 8c86a79

Browse files
committed
Retire impl_stable_hash_for_spanned.
1 parent e85c195 commit 8c86a79

File tree

4 files changed

+1
-32
lines changed

4 files changed

+1
-32
lines changed

src/librustc/ich/impls_hir.rs

-12
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use crate::ich::{StableHashingContext, NodeIdHashingMode, Fingerprint};
99
use rustc_data_structures::stable_hasher::{HashStable, ToStableHashKey, StableHasher};
1010
use smallvec::SmallVec;
1111
use std::mem;
12-
use syntax::ast;
1312
use syntax::attr;
1413

1514
impl<'a> HashStable<StableHashingContext<'a>> for DefId {
@@ -134,10 +133,6 @@ impl<'a> HashStable<StableHashingContext<'a>> for hir::Ty {
134133
}
135134
}
136135

137-
impl_stable_hash_for_spanned!(hir::BinOpKind);
138-
139-
impl_stable_hash_for_spanned!(ast::Name);
140-
141136
impl<'a> HashStable<StableHashingContext<'a>> for hir::Expr {
142137
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
143138
hcx.while_hashing_hir_bodies(true, |hcx| {
@@ -155,8 +150,6 @@ impl<'a> HashStable<StableHashingContext<'a>> for hir::Expr {
155150
}
156151
}
157152

158-
impl_stable_hash_for_spanned!(usize);
159-
160153
impl<'a> HashStable<StableHashingContext<'a>> for hir::TraitItem {
161154
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
162155
let hir::TraitItem {
@@ -225,8 +218,6 @@ impl<'a> HashStable<StableHashingContext<'a>> for hir::VisibilityKind {
225218
}
226219
}
227220

228-
impl_stable_hash_for_spanned!(hir::VisibilityKind);
229-
230221
impl<'a> HashStable<StableHashingContext<'a>> for hir::Mod {
231222
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
232223
let hir::Mod {
@@ -254,9 +245,6 @@ impl<'a> HashStable<StableHashingContext<'a>> for hir::Mod {
254245
}
255246
}
256247

257-
impl_stable_hash_for_spanned!(hir::Variant);
258-
259-
260248
impl<'a> HashStable<StableHashingContext<'a>> for hir::Item {
261249
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
262250
let hir::Item {

src/librustc/ich/impls_syntax.rs

-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
1818

1919
impl<'ctx> rustc_target::StableHashingContextLike for StableHashingContext<'ctx> {}
2020

21-
impl_stable_hash_for_spanned!(::syntax::ast::LitKind);
22-
2321
impl_stable_hash_for!(struct ::syntax::ast::Lifetime { id, ident });
2422

2523
impl<'a> HashStable<StableHashingContext<'a>> for [ast::Attribute] {

src/librustc/macros.rs

-17
Original file line numberDiff line numberDiff line change
@@ -166,23 +166,6 @@ macro_rules! impl_stable_hash_for {
166166
};
167167
}
168168

169-
#[macro_export]
170-
macro_rules! impl_stable_hash_for_spanned {
171-
($T:path) => (
172-
173-
impl HashStable<StableHashingContext<'a>> for ::syntax::source_map::Spanned<$T>
174-
{
175-
#[inline]
176-
fn hash_stable(&self,
177-
hcx: &mut StableHashingContext<'a>,
178-
hasher: &mut StableHasher) {
179-
self.node.hash_stable(hcx, hasher);
180-
self.span.hash_stable(hcx, hasher);
181-
}
182-
}
183-
);
184-
}
185-
186169
///////////////////////////////////////////////////////////////////////////
187170
// Lift and TypeFoldable macros
188171
//

src/libsyntax_pos/source_map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub fn original_sp(sp: Span, enclosing_sp: Span) -> Span {
3939
}
4040
}
4141

42-
#[derive(Clone, RustcEncodable, RustcDecodable, Debug, Copy)]
42+
#[derive(Clone, RustcEncodable, RustcDecodable, Debug, Copy, HashStable_Generic)]
4343
pub struct Spanned<T> {
4444
pub node: T,
4545
pub span: Span,

0 commit comments

Comments
 (0)