about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2018-04-01 08:22:40 +0200
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2018-04-17 16:43:30 +0200
commite5fc06da8a3b91c8787a6395722e551550161cff (patch)
treef9e9c52d25be53eb6e28ee6114fd60a434333ae4
parentbf06a532654515f2ea0536164adb991e8295be56 (diff)
downloadrust-e5fc06da8a3b91c8787a6395722e551550161cff.tar.gz
rust-e5fc06da8a3b91c8787a6395722e551550161cff.zip
Make one_time_diagnostics thread-safe
-rw-r--r--src/librustc/session/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs
index 2d7a256a369..2993234f266 100644
--- a/src/librustc/session/mod.rs
+++ b/src/librustc/session/mod.rs
@@ -89,7 +89,7 @@ pub struct Session {
     /// Set of (DiagnosticId, Option<Span>, message) tuples tracking
     /// (sub)diagnostics that have been set once, but should not be set again,
     /// in order to avoid redundantly verbose output (Issue #24690, #44953).
-    pub one_time_diagnostics: RefCell<FxHashSet<(DiagnosticMessageId, Option<Span>, String)>>,
+    pub one_time_diagnostics: Lock<FxHashSet<(DiagnosticMessageId, Option<Span>, String)>>,
     pub plugin_llvm_passes: OneThread<RefCell<Vec<String>>>,
     pub plugin_attributes: OneThread<RefCell<Vec<(String, AttributeType)>>>,
     pub crate_types: Once<Vec<config::CrateType>>,
@@ -1091,7 +1091,7 @@ pub fn build_session_(
         working_dir,
         lint_store: RwLock::new(lint::LintStore::new()),
         buffered_lints: Lock::new(Some(lint::LintBuffer::new())),
-        one_time_diagnostics: RefCell::new(FxHashSet()),
+        one_time_diagnostics: Lock::new(FxHashSet()),
         plugin_llvm_passes: OneThread::new(RefCell::new(Vec::new())),
         plugin_attributes: OneThread::new(RefCell::new(Vec::new())),
         crate_types: Once::new(),