about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2021-06-08 18:36:36 +0200
committerbjorn3 <bjorn3@users.noreply.github.com>2021-07-06 11:28:06 +0200
commit96d3bd467d0d038d2162715e6d5b365819e4aba1 (patch)
treeb09d56ba1ead3272d8d1e76e545639af57056094
parent489ad8b8b511df0d19fa3ef825240d020d240d3e (diff)
downloadrust-96d3bd467d0d038d2162715e6d5b365819e4aba1.tar.gz
rust-96d3bd467d0d038d2162715e6d5b365819e4aba1.zip
Revert "Revert "Fix test""
This reverts commit 6c5b6985fdce0921fe4ac0247fd026355953c1ea.
-rw-r--r--compiler/rustc_hir/src/tests.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/compiler/rustc_hir/src/tests.rs b/compiler/rustc_hir/src/tests.rs
index 2aafc6afa23..4636d515249 100644
--- a/compiler/rustc_hir/src/tests.rs
+++ b/compiler/rustc_hir/src/tests.rs
@@ -1,6 +1,4 @@
 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]
@@ -13,17 +11,16 @@ 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 d0 = CrateDisambiguator::from(Fingerprint::new(12, 34));
-    let d1 = CrateDisambiguator::from(Fingerprint::new(56, 78));
+    let id0 = StableCrateId::new("foo", false, vec!["1".to_string()]);
+    let id1 = StableCrateId::new("foo", false, vec!["2".to_string()]);
 
-    let h0 = mk_test_hash("foo", d0);
-    let h1 = mk_test_hash("foo", d1);
+    let h0 = mk_test_hash(id0);
+    let h1 = mk_test_hash(id1);
 
     assert_ne!(h0.stable_crate_id(), h1.stable_crate_id());
     assert_ne!(h0.local_hash(), h1.local_hash());
 
-    fn mk_test_hash(crate_name: &str, crate_disambiguator: CrateDisambiguator) -> DefPathHash {
-        let stable_crate_id = StableCrateId::new(crate_name, crate_disambiguator);
+    fn mk_test_hash(stable_crate_id: StableCrateId) -> DefPathHash {
         let parent_hash = DefPathHash::new(stable_crate_id, 0);
 
         let key = DefKey {