Skip to content

Commit d6c63ec

Browse files
committed
Fix OneThread
1 parent 577a5b2 commit d6c63ec

File tree

1 file changed

+3
-1
lines changed
  • src/librustc_data_structures

1 file changed

+3
-1
lines changed

src/librustc_data_structures/sync.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ use std::marker::PhantomData;
3636
use std::fmt::Debug;
3737
use std::fmt::Formatter;
3838
use std::fmt;
39-
use std;
4039
use std::ops::{Deref, DerefMut};
4140
use owning_ref::{Erased, OwningRef};
4241

@@ -200,6 +199,7 @@ cfg_if! {
200199
use parking_lot::Mutex as InnerLock;
201200
use parking_lot::RwLock as InnerRwLock;
202201

202+
use std;
203203
use std::thread;
204204
pub use rayon::{join, scope};
205205

@@ -638,7 +638,9 @@ pub struct OneThread<T> {
638638
inner: T,
639639
}
640640

641+
#[cfg(parallel_queries)]
641642
unsafe impl<T> std::marker::Sync for OneThread<T> {}
643+
#[cfg(parallel_queries)]
642644
unsafe impl<T> std::marker::Send for OneThread<T> {}
643645

644646
impl<T> OneThread<T> {

0 commit comments

Comments
 (0)