]> git.lizzy.rs Git - rust.git/commitdiff
Added `T:Send` bound to `Packet<T>` to avoid specialized `Drop` impl.
authorFelix S. Klock II <pnkfelix@pnkfx.org>
Sat, 21 Mar 2015 12:31:58 +0000 (13:31 +0100)
committerFelix S. Klock II <pnkfelix@pnkfx.org>
Tue, 24 Mar 2015 21:27:23 +0000 (22:27 +0100)
src/libstd/sync/mpsc/mod.rs
src/libstd/sync/mpsc/sync.rs

index 48629beafc8cd5cdbab2298b2942f4af5a6fff9c..eb421fe55a4d093ad80337808a5b61333232bd11 100644 (file)
@@ -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>>>,
 }
 
index 33c1614e1b297dfe7037782d6533c6c6fe19a943..71236269487ef8c803ce2fc1af7d01572cb025a9 100644 (file)
@@ -47,7 +47,7 @@
 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,