Skip to content

Commit 0f6c01d

Browse files
committed
Implement Sync for SyncSender
1 parent 107bd67 commit 0f6c01d

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

src/libstd/sync/mpsc/mod.rs

-5
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,6 @@ unsafe impl<T: Send> Send for Sender<T> { }
499499
impl<T> !Sync for Sender<T> { }
500500

501501
/// The sending-half of Rust's synchronous [`sync_channel`] type.
502-
/// This half can only be owned by one thread, but it can be cloned
503-
/// to send to other threads.
504502
///
505503
/// Messages can be sent through this channel with [`send`] or [`try_send`].
506504
///
@@ -555,9 +553,6 @@ pub struct SyncSender<T> {
555553
#[stable(feature = "rust1", since = "1.0.0")]
556554
unsafe impl<T: Send> Send for SyncSender<T> {}
557555

558-
#[stable(feature = "rust1", since = "1.0.0")]
559-
impl<T> !Sync for SyncSender<T> {}
560-
561556
/// An error returned from the [`Sender::send`] or [`SyncSender::send`]
562557
/// function on **channel**s.
563558
///

src/test/compile-fail/not-sync.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use std::cell::{Cell, RefCell};
1212
use std::rc::{Rc, Weak};
13-
use std::sync::mpsc::{Receiver, Sender, SyncSender};
13+
use std::sync::mpsc::{Receiver, Sender};
1414

1515
fn test<T: Sync>() {}
1616

@@ -29,6 +29,4 @@ fn main() {
2929
//~^ ERROR `std::sync::mpsc::Receiver<i32>: std::marker::Sync` is not satisfied
3030
test::<Sender<i32>>();
3131
//~^ ERROR `std::sync::mpsc::Sender<i32>: std::marker::Sync` is not satisfied
32-
test::<SyncSender<i32>>();
33-
//~^ ERROR `std::sync::mpsc::SyncSender<i32>: std::marker::Sync` is not satisfied
3432
}

0 commit comments

Comments
 (0)