Skip to content

Commit 1249e60

Browse files
committed
Added T:Send bound to Queue<T> to avoid specialized Drop impl.
1 parent 26a79e3 commit 1249e60

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/libstd/sync/mpsc/mpsc_queue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ struct Node<T> {
7272
/// The multi-producer single-consumer structure. This is not cloneable, but it
7373
/// may be safely shared so long as it is guaranteed that there is only one
7474
/// popper at a time (many pushers are allowed).
75-
pub struct Queue<T> {
75+
pub struct Queue<T: Send> {
7676
head: AtomicPtr<Node<T>>,
7777
tail: UnsafeCell<*mut Node<T>>,
7878
}

src/libstd/sync/mpsc/shared.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const MAX_STEALS: isize = 5;
4040
#[cfg(not(test))]
4141
const MAX_STEALS: isize = 1 << 20;
4242

43-
pub struct Packet<T> {
43+
pub struct Packet<T: Send> {
4444
queue: mpsc::Queue<T>,
4545
cnt: AtomicIsize, // How many items are on this channel
4646
steals: isize, // How many times has a port received without blocking?

0 commit comments

Comments
 (0)