Skip to content

Commit

Permalink
Move impl to def_id.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron1011 committed Feb 8, 2020
1 parent d4874e9 commit 8aa2f9f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 8 additions & 0 deletions src/librustc_span/def_id.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use crate::HashStableContext;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_data_structures::AtomicRef;
use rustc_index::vec::Idx;
use rustc_serialize::{Decoder, Encoder};
Expand Down Expand Up @@ -207,3 +209,9 @@ impl fmt::Debug for LocalDefId {

impl rustc_serialize::UseSpecializedEncodable for LocalDefId {}
impl rustc_serialize::UseSpecializedDecodable for LocalDefId {}

impl<CTX: HashStableContext> HashStable<CTX> for DefId {
fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher) {
hcx.hash_def_id(*self, hasher)
}
}
6 changes: 0 additions & 6 deletions src/librustc_span/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1653,9 +1653,3 @@ where
}
}
}

impl<CTX: HashStableContext> HashStable<CTX> for DefId {
fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher) {
hcx.hash_def_id(*self, hasher)
}
}

0 comments on commit 8aa2f9f

Please sign in to comment.