about summary refs log tree commit diff
path: root/compiler/rustc_session/src/cstore.rs
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2023-02-21 08:37:10 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2023-02-21 08:38:24 +0000
commitdecfb4d123651a0673db47542e18ca60d1c501ac (patch)
treecdfb83b31154c07755eaf21b97fa51ddfe01e64f /compiler/rustc_session/src/cstore.rs
parenta04e78730e501de7147ba8c09372348529b00c17 (diff)
downloadrust-decfb4d123651a0673db47542e18ca60d1c501ac.tar.gz
rust-decfb4d123651a0673db47542e18ca60d1c501ac.zip
Use a lock-free datastructure for `source_span`
Diffstat (limited to 'compiler/rustc_session/src/cstore.rs')
-rw-r--r--compiler/rustc_session/src/cstore.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_session/src/cstore.rs b/compiler/rustc_session/src/cstore.rs
index ff13a0bbf3f..868ffdf0f1d 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;
@@ -255,6 +254,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: RwLock<IndexVec<LocalDefId, Span>>,
+    pub source_span: AppendOnlyVec<LocalDefId, Span>,
     pub definitions: RwLock<Definitions>,
 }