Switch crate graph to use an Arena instead of a hashmap

This commit is contained in:
Lukas Wirth 2023-04-05 08:41:13 +02:00
parent 236576227a
commit 7f0fbf7f9d
15 changed files with 1499 additions and 1593 deletions

View file

@ -13,7 +13,7 @@ use cfg::{CfgDiff, CfgOptions};
use paths::{AbsPath, AbsPathBuf};
use rustc_hash::{FxHashMap, FxHashSet};
use semver::Version;
use stdx::{always, hash::NoHashHashMap};
use stdx::always;
use crate::{
build_scripts::BuildScriptOutput,
@ -732,7 +732,7 @@ fn project_json_to_crate_graph(
});
let mut cfg_cache: FxHashMap<&str, Vec<CfgFlag>> = FxHashMap::default();
let crates: NoHashHashMap<CrateId, CrateId> = project
let crates: FxHashMap<CrateId, CrateId> = project
.crates()
.filter_map(|(crate_id, krate)| Some((crate_id, krate, load(&krate.root_module)?)))
.map(