about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2021-06-01 16:31:58 +0200
committerbjorn3 <bjorn3@users.noreply.github.com>2021-06-07 10:25:32 +0200
commit6c5b6985fdce0921fe4ac0247fd026355953c1ea (patch)
tree98c2ec55e2a9ad567e43a6164b2f69aed5efc694
parent715c68fe90c6f1d0b3004ad18f16e0811f209992 (diff)
downloadrust-6c5b6985fdce0921fe4ac0247fd026355953c1ea.tar.gz
rust-6c5b6985fdce0921fe4ac0247fd026355953c1ea.zip
Revert "Fix test"
This reverts commit 3abdebe79d9a3a2256a36fe8f408dad6a466f89f.
-rw-r--r--compiler/rustc_hir/src/tests.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/compiler/rustc_hir/src/tests.rs b/compiler/rustc_hir/src/tests.rs
index 4636d515249..2aafc6afa23 100644
--- a/compiler/rustc_hir/src/tests.rs
+++ b/compiler/rustc_hir/src/tests.rs
@@ -1,4 +1,6 @@
 use crate::definitions::{DefKey, DefPathData, DisambiguatedDefPathData};
+use rustc_data_structures::fingerprint::Fingerprint;
+use rustc_span::crate_disambiguator::CrateDisambiguator;
 use rustc_span::def_id::{DefPathHash, StableCrateId};
 
 #[test]
@@ -11,16 +13,17 @@ fn def_path_hash_depends_on_crate_id() {
     // the crate by changing the crate disambiguator (e.g. via bumping the
     // crate's version number).
 
-    let id0 = StableCrateId::new("foo", false, vec!["1".to_string()]);
-    let id1 = StableCrateId::new("foo", false, vec!["2".to_string()]);
+    let d0 = CrateDisambiguator::from(Fingerprint::new(12, 34));
+    let d1 = CrateDisambiguator::from(Fingerprint::new(56, 78));
 
-    let h0 = mk_test_hash(id0);
-    let h1 = mk_test_hash(id1);
+    let h0 = mk_test_hash("foo", d0);
+    let h1 = mk_test_hash("foo", d1);
 
     assert_ne!(h0.stable_crate_id(), h1.stable_crate_id());
     assert_ne!(h0.local_hash(), h1.local_hash());
 
-    fn mk_test_hash(stable_crate_id: StableCrateId) -> DefPathHash {
+    fn mk_test_hash(crate_name: &str, crate_disambiguator: CrateDisambiguator) -> DefPathHash {
+        let stable_crate_id = StableCrateId::new(crate_name, crate_disambiguator);
         let parent_hash = DefPathHash::new(stable_crate_id, 0);
 
         let key = DefKey {