From 0f6c01ddb6a493fe61452f657dcb43313203bfe8 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Fri, 2 Jun 2017 18:35:37 -0700 Subject: [PATCH] Implement Sync for SyncSender --- src/libstd/sync/mpsc/mod.rs | 5 ----- src/test/compile-fail/not-sync.rs | 4 +--- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index 40b3e789ce4a3..32343a57413ea 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -499,8 +499,6 @@ unsafe impl Send for Sender { } impl !Sync for Sender { } /// 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 { #[stable(feature = "rust1", since = "1.0.0")] unsafe impl Send for SyncSender {} -#[stable(feature = "rust1", since = "1.0.0")] -impl !Sync for SyncSender {} - /// 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 aa7a83a7baac9..12c2927917890 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() {} @@ -29,6 +29,4 @@ fn main() { //~^ ERROR `std::sync::mpsc::Receiver: std::marker::Sync` is not satisfied test::>(); //~^ ERROR `std::sync::mpsc::Sender: std::marker::Sync` is not satisfied - test::>(); - //~^ ERROR `std::sync::mpsc::SyncSender: std::marker::Sync` is not satisfied }