From eb349e35aa4e466105695c64efb51bc9e45e0d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20K=C3=A5re=20Alsaker?= Date: Sat, 31 Oct 2020 03:14:32 +0100 Subject: [PATCH] Use conditional synchronization for Lock --- src/parse/session.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/parse/session.rs b/src/parse/session.rs index 945e3e42fdd..d815d69d6ba 100644 --- a/src/parse/session.rs +++ b/src/parse/session.rs @@ -1,8 +1,8 @@ use std::path::Path; use std::sync::atomic::{AtomicBool, Ordering}; -use rustc_data_structures::sync::{Lrc, Send}; -use rustc_errors::emitter::{Emitter, EmitterWriter}; +use rustc_data_structures::sync::{IntoDynSyncSend, Lrc}; +use rustc_errors::emitter::{DynEmitter, Emitter, EmitterWriter}; use rustc_errors::translation::Translate; use rustc_errors::{ColorConfig, Diagnostic, Handler, Level as DiagnosticLevel}; use rustc_session::parse::ParseSess as RawParseSess; @@ -48,15 +48,15 @@ fn source_map(&self) -> Option<&Lrc> { fn emit_diagnostic(&mut self, _db: &Diagnostic) {} } -fn silent_emitter() -> Box { +fn silent_emitter() -> Box { Box::new(SilentEmitter {}) } /// Emit errors against every files expect ones specified in the `ignore_path_set`. struct SilentOnIgnoredFilesEmitter { - ignore_path_set: Lrc, + ignore_path_set: IntoDynSyncSend>, source_map: Lrc, - emitter: Box, + emitter: Box, has_non_ignorable_parser_errors: bool, can_reset: Lrc, } @@ -145,7 +145,7 @@ fn default_handler( has_non_ignorable_parser_errors: false, source_map, emitter, - ignore_path_set, + ignore_path_set: IntoDynSyncSend(ignore_path_set), can_reset, })) } @@ -396,7 +396,7 @@ fn build_emitter( has_non_ignorable_parser_errors: false, source_map, emitter: Box::new(emitter_writer), - ignore_path_set, + ignore_path_set: IntoDynSyncSend(ignore_path_set), can_reset, } }