1
Fork 0

Add a usize-indexed append-only-vec

This commit is contained in:
Oli Scherer 2023-03-14 11:51:00 +00:00
parent c7a3a943f2
commit daee746771
4 changed files with 39 additions and 7 deletions

View file

@ -6,7 +6,7 @@ use crate::search_paths::PathKind;
use crate::utils::NativeLibKind;
use crate::Session;
use rustc_ast as ast;
use rustc_data_structures::sync::{self, AppendOnlyVec, MetadataRef, RwLock};
use rustc_data_structures::sync::{self, AppendOnlyIndexVec, MetadataRef, RwLock};
use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, StableCrateId, LOCAL_CRATE};
use rustc_hir::definitions::{DefKey, DefPath, DefPathHash, Definitions};
use rustc_span::hygiene::{ExpnHash, ExpnId};
@ -257,6 +257,6 @@ pub type CrateStoreDyn = dyn CrateStore + sync::Sync + sync::Send;
pub struct Untracked {
pub cstore: RwLock<Box<CrateStoreDyn>>,
/// Reference span for definitions.
pub source_span: AppendOnlyVec<LocalDefId, Span>,
pub source_span: AppendOnlyIndexVec<LocalDefId, Span>,
pub definitions: RwLock<Definitions>,
}