diff --git a/src/librustc_data_structures/sync.rs b/src/librustc_data_structures/sync.rs index 366176313301..9cceee65bf9a 100644 --- a/src/librustc_data_structures/sync.rs +++ b/src/librustc_data_structures/sync.rs @@ -36,7 +36,6 @@ use std::fmt::Debug; use std::fmt::Formatter; use std::fmt; -use std; use std::ops::{Deref, DerefMut}; use owning_ref::{Erased, OwningRef}; @@ -200,6 +199,7 @@ pub fn take(&self) -> Option { use parking_lot::Mutex as InnerLock; use parking_lot::RwLock as InnerRwLock; + use std; use std::thread; pub use rayon::{join, scope}; @@ -638,7 +638,9 @@ pub struct OneThread { inner: T, } +#[cfg(parallel_queries)] unsafe impl std::marker::Sync for OneThread {} +#[cfg(parallel_queries)] unsafe impl std::marker::Send for OneThread {} impl OneThread {