Skip to content

Commit 123b5c1

Browse files
committed
Added T:Send bound to Packet<T> to avoid specialized Drop impl.
1 parent 018eeb7 commit 123b5c1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/libstd/sync/mpsc/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ unsafe impl<T: Send> Send for Sender<T> { }
372372
/// The sending-half of Rust's synchronous channel type. This half can only be
373373
/// owned by one task, but it can be cloned to send to other tasks.
374374
#[stable(feature = "rust1", since = "1.0.0")]
375-
pub struct SyncSender<T> {
375+
pub struct SyncSender<T: Send> {
376376
inner: Arc<UnsafeCell<sync::Packet<T>>>,
377377
}
378378

src/libstd/sync/mpsc/sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ use sync::mpsc::blocking::{self, WaitToken, SignalToken};
4747
use sync::mpsc::select::StartResult::{self, Installed, Abort};
4848
use sync::{Mutex, MutexGuard};
4949

50-
pub struct Packet<T> {
50+
pub struct Packet<T: Send> {
5151
/// Only field outside of the mutex. Just done for kicks, but mainly because
5252
/// the other shared channel already had the code implemented
5353
channels: AtomicUsize,

0 commit comments

Comments
 (0)