diff options
Diffstat (limited to 'compiler/rustc_middle/src/mir/mono.rs')
| -rw-r--r-- | compiler/rustc_middle/src/mir/mono.rs | 19 | 
1 files changed, 5 insertions, 14 deletions
diff --git a/compiler/rustc_middle/src/mir/mono.rs b/compiler/rustc_middle/src/mir/mono.rs index f592f1515c1..a9468a90b53 100644 --- a/compiler/rustc_middle/src/mir/mono.rs +++ b/compiler/rustc_middle/src/mir/mono.rs @@ -4,7 +4,7 @@ use rustc_attr::InlineAttr; use rustc_data_structures::base_n; use rustc_data_structures::fingerprint::Fingerprint; use rustc_data_structures::fx::FxHashMap; -use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; +use rustc_data_structures::stable_hasher::{Hash128, HashStable, StableHasher}; use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE}; use rustc_hir::ItemId; use rustc_index::vec::Idx; @@ -313,8 +313,8 @@ impl<'tcx> CodegenUnit<'tcx> { // avoid collisions and is still reasonably short for filenames. let mut hasher = StableHasher::new(); human_readable_name.hash(&mut hasher); - let hash: u128 = hasher.finish(); - let hash = hash & ((1u128 << 80) - 1); + let hash: Hash128 = hasher.finish(); + let hash = hash.as_u128() & ((1u128 << 80) - 1); base_n::encode(hash, base_n::CASE_INSENSITIVE) } @@ -505,22 +505,13 @@ impl<'tcx> CodegenUnitNameBuilder<'tcx> { // instantiating stuff for upstream crates. let local_crate_id = if cnum != LOCAL_CRATE { let local_stable_crate_id = tcx.sess.local_stable_crate_id(); - format!( - "-in-{}.{:08x}", - tcx.crate_name(LOCAL_CRATE), - local_stable_crate_id.to_u64() as u32, - ) + format!("-in-{}.{:08x}", tcx.crate_name(LOCAL_CRATE), local_stable_crate_id) } else { String::new() }; let stable_crate_id = tcx.sess.local_stable_crate_id(); - format!( - "{}.{:08x}{}", - tcx.crate_name(cnum), - stable_crate_id.to_u64() as u32, - local_crate_id, - ) + format!("{}.{:08x}{}", tcx.crate_name(cnum), stable_crate_id, local_crate_id) }); write!(cgu_name, "{}", crate_prefix).unwrap();  | 
