1
Fork 0

Add Freeze type and use it to store Definitions

This commit is contained in:
John Kåre Alsaker 2023-08-31 09:16:33 +02:00
parent 9dc11a13fa
commit 0c96a9260b
6 changed files with 122 additions and 15 deletions

View file

@ -7,7 +7,7 @@ use crate::utils::NativeLibKind;
use crate::Session;
use rustc_ast as ast;
use rustc_data_structures::owned_slice::OwnedSlice;
use rustc_data_structures::sync::{self, AppendOnlyIndexVec, RwLock};
use rustc_data_structures::sync::{self, AppendOnlyIndexVec, Freeze, 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};
@ -261,5 +261,5 @@ pub struct Untracked {
pub cstore: RwLock<Box<CrateStoreDyn>>,
/// Reference span for definitions.
pub source_span: AppendOnlyIndexVec<LocalDefId, Span>,
pub definitions: RwLock<Definitions>,
pub definitions: Freeze<Definitions>,
}