Skip to content

Commit

Permalink
Revert "Fix test"
Browse files Browse the repository at this point in the history
This reverts commit 3abdebe.
  • Loading branch information
bjorn3 committed Jun 7, 2021
1 parent 715c68f commit 6c5b698
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions compiler/rustc_hir/src/tests.rs
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -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 {
Expand Down

0 comments on commit 6c5b698

Please sign in to comment.