about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSteven Fackler <sfackler@gmail.com>2017-06-02 18:35:37 -0700
committerSteven Fackler <sfackler@gmail.com>2017-06-02 21:09:09 -0700
commit0f6c01ddb6a493fe61452f657dcb43313203bfe8 (patch)
tree532adf171fc677b4a9afb765607649d88cfdc831
parent107bd67ef7fb3e8027d7234d687cdd27c3efaa0d (diff)
downloadrust-0f6c01ddb6a493fe61452f657dcb43313203bfe8.tar.gz
rust-0f6c01ddb6a493fe61452f657dcb43313203bfe8.zip
Implement Sync for SyncSender
-rw-r--r--src/libstd/sync/mpsc/mod.rs5
-rw-r--r--src/test/compile-fail/not-sync.rs4
2 files changed, 1 insertions, 8 deletions
diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs
index 40b3e789ce4..32343a57413 100644
--- a/src/libstd/sync/mpsc/mod.rs
+++ b/src/libstd/sync/mpsc/mod.rs
@@ -499,8 +499,6 @@ unsafe impl<T: Send> Send for Sender<T> { }
 impl<T> !Sync for Sender<T> { }
 
 /// The sending-half of Rust's synchronous [`sync_channel`] type.
-/// This half can only be owned by one thread, but it can be cloned
-/// to send to other threads.
 ///
 /// Messages can be sent through this channel with [`send`] or [`try_send`].
 ///
@@ -555,9 +553,6 @@ pub struct SyncSender<T> {
 #[stable(feature = "rust1", since = "1.0.0")]
 unsafe impl<T: Send> Send for SyncSender<T> {}
 
-#[stable(feature = "rust1", since = "1.0.0")]
-impl<T> !Sync for SyncSender<T> {}
-
 /// An error returned from the [`Sender::send`] or [`SyncSender::send`]
 /// function on **channel**s.
 ///
diff --git a/src/test/compile-fail/not-sync.rs b/src/test/compile-fail/not-sync.rs
index aa7a83a7baa..12c29279178 100644
--- a/src/test/compile-fail/not-sync.rs
+++ b/src/test/compile-fail/not-sync.rs
@@ -10,7 +10,7 @@
 
 use std::cell::{Cell, RefCell};
 use std::rc::{Rc, Weak};
-use std::sync::mpsc::{Receiver, Sender, SyncSender};
+use std::sync::mpsc::{Receiver, Sender};
 
 fn test<T: Sync>() {}
 
@@ -29,6 +29,4 @@ fn main() {
     //~^ ERROR `std::sync::mpsc::Receiver<i32>: std::marker::Sync` is not satisfied
     test::<Sender<i32>>();
     //~^ ERROR `std::sync::mpsc::Sender<i32>: std::marker::Sync` is not satisfied
-    test::<SyncSender<i32>>();
-    //~^ ERROR `std::sync::mpsc::SyncSender<i32>: std::marker::Sync` is not satisfied
 }