diff options
| author | Michael Woerister <michaelwoerister@posteo> | 2017-10-16 14:43:36 +0200 |
|---|---|---|
| committer | Michael Woerister <michaelwoerister@posteo> | 2017-10-16 14:44:40 +0200 |
| commit | 10e289e19131b5339ef1a2e001ae0cfcf330c1b0 (patch) | |
| tree | 16d51e7364642dc9235b20858221e519c26f495d | |
| parent | 74ebad4b63ce2ccaa6051b60031a6597ee4468ec (diff) | |
| download | rust-10e289e19131b5339ef1a2e001ae0cfcf330c1b0.tar.gz rust-10e289e19131b5339ef1a2e001ae0cfcf330c1b0.zip | |
Make debuginfo::UniqueTypeId use 128 bit hash.
| -rw-r--r-- | src/librustc_data_structures/stable_hasher.rs | 31 | ||||
| -rw-r--r-- | src/librustc_trans/debuginfo/metadata.rs | 7 |
2 files changed, 3 insertions, 35 deletions
diff --git a/src/librustc_data_structures/stable_hasher.rs b/src/librustc_data_structures/stable_hasher.rs index 3e526900110..831e113016f 100644 --- a/src/librustc_data_structures/stable_hasher.rs +++ b/src/librustc_data_structures/stable_hasher.rs @@ -61,37 +61,6 @@ impl<W: StableHasherResult> StableHasher<W> { } } -impl StableHasherResult for [u8; 20] { - fn finish(hasher: StableHasher<Self>) -> Self { - let (_0, _1) = hasher.finalize(); - - [ - (_0 >> 0) as u8, - (_0 >> 8) as u8, - (_0 >> 16) as u8, - (_0 >> 24) as u8, - (_0 >> 32) as u8, - (_0 >> 40) as u8, - (_0 >> 48) as u8, - (_0 >> 56) as u8, - - 17, - 33, - 47, - 3, - - (_1 >> 0) as u8, - (_1 >> 8) as u8, - (_1 >> 16) as u8, - (_1 >> 24) as u8, - (_1 >> 32) as u8, - (_1 >> 40) as u8, - (_1 >> 48) as u8, - (_1 >> 56) as u8, - ] - } -} - impl StableHasherResult for u128 { fn finish(hasher: StableHasher<Self>) -> Self { let (_0, _1) = hasher.finalize(); diff --git a/src/librustc_trans/debuginfo/metadata.rs b/src/librustc_trans/debuginfo/metadata.rs index 8a89bfee4ac..201d7867764 100644 --- a/src/librustc_trans/debuginfo/metadata.rs +++ b/src/librustc_trans/debuginfo/metadata.rs @@ -30,7 +30,7 @@ use rustc::ty::fold::TypeVisitor; use rustc::ty::subst::Substs; use rustc::ty::util::TypeIdHasher; use rustc::hir; -use rustc_data_structures::ToHex; +use rustc::ich::Fingerprint; use {type_of, machine, monomorphize}; use common::{self, CrateContext}; use type_::Type; @@ -146,11 +146,10 @@ impl<'tcx> TypeMap<'tcx> { // The hasher we are using to generate the UniqueTypeId. We want // something that provides more than the 64 bits of the DefaultHasher. - - let mut type_id_hasher = TypeIdHasher::<[u8; 20]>::new(cx.tcx()); + let mut type_id_hasher = TypeIdHasher::<Fingerprint>::new(cx.tcx()); type_id_hasher.visit_ty(type_); - let unique_type_id = type_id_hasher.finish().to_hex(); + let key = self.unique_id_interner.intern(&unique_type_id); self.type_to_unique_id.insert(type_, UniqueTypeId(key)); |
