Move stable_crate_ids
from CrateStore
to Untracked
This way it's like `Definitions`, which creates `DefId`s by interning `DefPathData`s, but for interning stable crate hashes
This commit is contained in:
parent
10be74569c
commit
fbc9b94064
5 changed files with 42 additions and 32 deletions
|
@ -6,7 +6,9 @@ use crate::search_paths::PathKind;
|
|||
use crate::utils::NativeLibKind;
|
||||
use rustc_ast as ast;
|
||||
use rustc_data_structures::sync::{self, AppendOnlyIndexVec, FreezeLock};
|
||||
use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, StableCrateId, LOCAL_CRATE};
|
||||
use rustc_hir::def_id::{
|
||||
CrateNum, DefId, LocalDefId, StableCrateId, StableCrateIdMap, LOCAL_CRATE,
|
||||
};
|
||||
use rustc_hir::definitions::{DefKey, DefPath, DefPathHash, Definitions};
|
||||
use rustc_span::symbol::Symbol;
|
||||
use rustc_span::Span;
|
||||
|
@ -217,7 +219,6 @@ pub trait CrateStore: std::fmt::Debug {
|
|||
// incr. comp. uses to identify a CrateNum.
|
||||
fn crate_name(&self, cnum: CrateNum) -> Symbol;
|
||||
fn stable_crate_id(&self, cnum: CrateNum) -> StableCrateId;
|
||||
fn stable_crate_id_to_crate_num(&self, stable_crate_id: StableCrateId) -> CrateNum;
|
||||
}
|
||||
|
||||
pub type CrateStoreDyn = dyn CrateStore + sync::DynSync + sync::DynSend;
|
||||
|
@ -227,4 +228,6 @@ pub struct Untracked {
|
|||
/// Reference span for definitions.
|
||||
pub source_span: AppendOnlyIndexVec<LocalDefId, Span>,
|
||||
pub definitions: FreezeLock<Definitions>,
|
||||
/// The interned [StableCrateId]s.
|
||||
pub stable_crate_ids: FreezeLock<StableCrateIdMap>,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue