1
Fork 0

Merge CrateDisambiguator into StableCrateId

This commit is contained in:
bjorn3 2021-05-29 12:09:23 +02:00
parent d93b6a4598
commit d0ec85d3fb
30 changed files with 125 additions and 207 deletions

View file

@ -14,7 +14,6 @@ use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::stable_hasher::StableHasher;
use rustc_data_structures::unhash::UnhashMap;
use rustc_index::vec::IndexVec;
use rustc_span::crate_disambiguator::CrateDisambiguator;
use rustc_span::hygiene::ExpnId;
use rustc_span::symbol::{kw, sym, Symbol};
@ -338,7 +337,7 @@ impl Definitions {
}
/// Adds a root definition (no parent) and a few other reserved definitions.
pub fn new(crate_name: &str, crate_disambiguator: CrateDisambiguator) -> Definitions {
pub fn new(stable_crate_id: StableCrateId) -> Definitions {
let key = DefKey {
parent: None,
disambiguated_data: DisambiguatedDefPathData {
@ -347,7 +346,6 @@ impl Definitions {
},
};
let stable_crate_id = StableCrateId::new(crate_name, crate_disambiguator);
let parent_hash = DefPathHash::new(stable_crate_id, 0);
let def_path_hash = key.compute_stable_hash(parent_hash);