1
Fork 0

Make untracked.cstore lockable so that resolution can still write to it when using TyCtxt

This commit is contained in:
Oli Scherer 2022-12-08 10:53:20 +00:00
parent e8e227aec8
commit ade3dceb38
9 changed files with 50 additions and 36 deletions

View file

@ -205,7 +205,7 @@ pub trait MetadataLoader {
fn get_dylib_metadata(&self, target: &Target, filename: &Path) -> Result<MetadataRef, String>;
}
pub type MetadataLoaderDyn = dyn MetadataLoader + Sync;
pub type MetadataLoaderDyn = dyn MetadataLoader + Send + Sync;
/// A store of Rust crates, through which their metadata can be accessed.
///
@ -250,11 +250,11 @@ pub trait CrateStore: std::fmt::Debug {
fn import_source_files(&self, sess: &Session, cnum: CrateNum);
}
pub type CrateStoreDyn = dyn CrateStore + sync::Sync;
pub type CrateStoreDyn = dyn CrateStore + sync::Sync + sync::Send;
#[derive(Debug)]
pub struct Untracked {
pub cstore: Box<CrateStoreDyn>,
pub cstore: RwLock<Box<CrateStoreDyn>>,
/// Reference span for definitions.
pub source_span: IndexVec<LocalDefId, Span>,
pub definitions: RwLock<Definitions>,