Skip to content

Commit 8aa2f9f

Browse files
committed
Move impl to def_id.rs
1 parent d4874e9 commit 8aa2f9f

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/librustc_span/def_id.rs

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use crate::HashStableContext;
2+
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
13
use rustc_data_structures::AtomicRef;
24
use rustc_index::vec::Idx;
35
use rustc_serialize::{Decoder, Encoder};
@@ -207,3 +209,9 @@ impl fmt::Debug for LocalDefId {
207209

208210
impl rustc_serialize::UseSpecializedEncodable for LocalDefId {}
209211
impl rustc_serialize::UseSpecializedDecodable for LocalDefId {}
212+
213+
impl<CTX: HashStableContext> HashStable<CTX> for DefId {
214+
fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher) {
215+
hcx.hash_def_id(*self, hasher)
216+
}
217+
}

src/librustc_span/lib.rs

-6
Original file line numberDiff line numberDiff line change
@@ -1653,9 +1653,3 @@ where
16531653
}
16541654
}
16551655
}
1656-
1657-
impl<CTX: HashStableContext> HashStable<CTX> for DefId {
1658-
fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher) {
1659-
hcx.hash_def_id(*self, hasher)
1660-
}
1661-
}

0 commit comments

Comments
 (0)