about summary refs log tree commit diff
path: root/src/libstd/sync
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2015-03-21 13:31:58 +0100
committerFelix S. Klock II <pnkfelix@pnkfx.org>2015-03-24 22:27:23 +0100
commit123b5c124e12ba08bd351c414753902aae9eb045 (patch)
tree5735e4f6261687ac3d7680a3bdc368cc501dc15d /src/libstd/sync
parent018eeb76f0e7384f760afa2a97a07110eef05145 (diff)
downloadrust-123b5c124e12ba08bd351c414753902aae9eb045.tar.gz
rust-123b5c124e12ba08bd351c414753902aae9eb045.zip
Added `T:Send` bound to `Packet<T>` to avoid specialized `Drop` impl.
Diffstat (limited to 'src/libstd/sync')
-rw-r--r--src/libstd/sync/mpsc/mod.rs2
-rw-r--r--src/libstd/sync/mpsc/sync.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs
index 48629beafc8..eb421fe55a4 100644
--- a/src/libstd/sync/mpsc/mod.rs
+++ b/src/libstd/sync/mpsc/mod.rs
@@ -372,7 +372,7 @@ unsafe impl<T: Send> Send for Sender<T> { }
 /// The sending-half of Rust's synchronous channel type. This half can only be
 /// owned by one task, but it can be cloned to send to other tasks.
 #[stable(feature = "rust1", since = "1.0.0")]
-pub struct SyncSender<T> {
+pub struct SyncSender<T: Send> {
     inner: Arc<UnsafeCell<sync::Packet<T>>>,
 }
 
diff --git a/src/libstd/sync/mpsc/sync.rs b/src/libstd/sync/mpsc/sync.rs
index 33c1614e1b2..71236269487 100644
--- a/src/libstd/sync/mpsc/sync.rs
+++ b/src/libstd/sync/mpsc/sync.rs
@@ -47,7 +47,7 @@ use sync::mpsc::blocking::{self, WaitToken, SignalToken};
 use sync::mpsc::select::StartResult::{self, Installed, Abort};
 use sync::{Mutex, MutexGuard};
 
-pub struct Packet<T> {
+pub struct Packet<T: Send> {
     /// Only field outside of the mutex. Just done for kicks, but mainly because
     /// the other shared channel already had the code implemented
     channels: AtomicUsize,