diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:41 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:41 +0000 |
commit | 4f9fe856a25ab29345b90e7725509e9ee38a37be (patch) | |
tree | e4ffd8a9374cae7b21f7cbfb352927e0e074aff6 /compiler/rustc_session/src/cstore.rs | |
parent | Adding upstream version 1.68.2+dfsg1. (diff) | |
download | rustc-4f9fe856a25ab29345b90e7725509e9ee38a37be.tar.xz rustc-4f9fe856a25ab29345b90e7725509e9ee38a37be.zip |
Adding upstream version 1.69.0+dfsg1.upstream/1.69.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | compiler/rustc_session/src/cstore.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/compiler/rustc_session/src/cstore.rs b/compiler/rustc_session/src/cstore.rs index 4ae9a3fae..868ffdf0f 100644 --- a/compiler/rustc_session/src/cstore.rs +++ b/compiler/rustc_session/src/cstore.rs @@ -6,10 +6,9 @@ use crate::search_paths::PathKind; use crate::utils::NativeLibKind; use crate::Session; use rustc_ast as ast; -use rustc_data_structures::sync::{self, MetadataRef, RwLock}; +use rustc_data_structures::sync::{self, AppendOnlyVec, MetadataRef, RwLock}; use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, StableCrateId, LOCAL_CRATE}; use rustc_hir::definitions::{DefKey, DefPath, DefPathHash, Definitions}; -use rustc_index::vec::IndexVec; use rustc_span::hygiene::{ExpnHash, ExpnId}; use rustc_span::symbol::Symbol; use rustc_span::Span; @@ -200,12 +199,12 @@ pub enum ExternCrateSource { /// At the time of this writing, there is only one backend and one way to store /// metadata in library -- this trait just serves to decouple rustc_metadata from /// the archive reader, which depends on LLVM. -pub trait MetadataLoader { +pub trait MetadataLoader: std::fmt::Debug { fn get_rlib_metadata(&self, target: &Target, filename: &Path) -> Result<MetadataRef, String>; 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,12 +249,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 source_span: AppendOnlyVec<LocalDefId, Span>, pub definitions: RwLock<Definitions>, } |