Skip to content

Commit 0affaa2

Browse files
committed
---
yaml --- r: 194204 b: refs/heads/beta c: 0adab50 h: refs/heads/master v: v3
1 parent a33f5f8 commit 0affaa2

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: 5fa4b4c4af14e391d7f16b4968aa25cca7c617c6
34+
refs/heads/beta: 0adab507bbb0b04fe389a00af19fc17753b76343
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: de8a23bbc3a7b9cbd7574b5b91a34af59bf030e6

branches/beta/src/libstd/sync/mpsc/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ mod spsc_queue;
342342
/// The receiving-half of Rust's channel type. This half can only be owned by
343343
/// one task
344344
#[stable(feature = "rust1", since = "1.0.0")]
345-
pub struct Receiver<T> {
345+
pub struct Receiver<T:Send> {
346346
inner: UnsafeCell<Flavor<T>>,
347347
}
348348

@@ -354,14 +354,14 @@ unsafe impl<T: Send> Send for Receiver<T> { }
354354
/// whenever `next` is called, waiting for a new message, and `None` will be
355355
/// returned when the corresponding channel has hung up.
356356
#[stable(feature = "rust1", since = "1.0.0")]
357-
pub struct Iter<'a, T:'a> {
357+
pub struct Iter<'a, T:Send+'a> {
358358
rx: &'a Receiver<T>
359359
}
360360

361361
/// The sending-half of Rust's asynchronous channel type. This half can only be
362362
/// owned by one task, but it can be cloned to send to other tasks.
363363
#[stable(feature = "rust1", since = "1.0.0")]
364-
pub struct Sender<T> {
364+
pub struct Sender<T:Send> {
365365
inner: UnsafeCell<Flavor<T>>,
366366
}
367367

@@ -433,15 +433,15 @@ pub enum TrySendError<T> {
433433
Disconnected(T),
434434
}
435435

436-
enum Flavor<T> {
436+
enum Flavor<T:Send> {
437437
Oneshot(Arc<UnsafeCell<oneshot::Packet<T>>>),
438438
Stream(Arc<UnsafeCell<stream::Packet<T>>>),
439439
Shared(Arc<UnsafeCell<shared::Packet<T>>>),
440440
Sync(Arc<UnsafeCell<sync::Packet<T>>>),
441441
}
442442

443443
#[doc(hidden)]
444-
trait UnsafeFlavor<T> {
444+
trait UnsafeFlavor<T:Send> {
445445
fn inner_unsafe<'a>(&'a self) -> &'a UnsafeCell<Flavor<T>>;
446446
unsafe fn inner_mut<'a>(&'a self) -> &'a mut Flavor<T> {
447447
&mut *self.inner_unsafe().get()
@@ -450,12 +450,12 @@ trait UnsafeFlavor<T> {
450450
&*self.inner_unsafe().get()
451451
}
452452
}
453-
impl<T> UnsafeFlavor<T> for Sender<T> {
453+
impl<T:Send> UnsafeFlavor<T> for Sender<T> {
454454
fn inner_unsafe<'a>(&'a self) -> &'a UnsafeCell<Flavor<T>> {
455455
&self.inner
456456
}
457457
}
458-
impl<T> UnsafeFlavor<T> for Receiver<T> {
458+
impl<T:Send> UnsafeFlavor<T> for Receiver<T> {
459459
fn inner_unsafe<'a>(&'a self) -> &'a UnsafeCell<Flavor<T>> {
460460
&self.inner
461461
}

branches/beta/src/libstd/sync/mpsc/oneshot.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const DISCONNECTED: usize = 2; // channel is disconnected OR upgraded
5454
// moves *from* a pointer, ownership of the token is transferred to
5555
// whoever changed the state.
5656

57-
pub struct Packet<T> {
57+
pub struct Packet<T:Send> {
5858
// Internal state of the chan/port pair (stores the blocked task as well)
5959
state: AtomicUsize,
6060
// One-shot data slot location
@@ -64,7 +64,7 @@ pub struct Packet<T> {
6464
upgrade: MyUpgrade<T>,
6565
}
6666

67-
pub enum Failure<T> {
67+
pub enum Failure<T:Send> {
6868
Empty,
6969
Disconnected,
7070
Upgraded(Receiver<T>),
@@ -76,13 +76,13 @@ pub enum UpgradeResult {
7676
UpWoke(SignalToken),
7777
}
7878

79-
pub enum SelectionResult<T> {
79+
pub enum SelectionResult<T:Send> {
8080
SelCanceled,
8181
SelUpgraded(SignalToken, Receiver<T>),
8282
SelSuccess,
8383
}
8484

85-
enum MyUpgrade<T> {
85+
enum MyUpgrade<T:Send> {
8686
NothingSent,
8787
SendUsed,
8888
GoUp(Receiver<T>),

branches/beta/src/libstd/sync/mpsc/select.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl !marker::Send for Select {}
8080
/// A handle to a receiver which is currently a member of a `Select` set of
8181
/// receivers. This handle is used to keep the receiver in the set as well as
8282
/// interact with the underlying receiver.
83-
pub struct Handle<'rx, T:'rx> {
83+
pub struct Handle<'rx, T:Send+'rx> {
8484
/// The ID of this handle, used to compare against the return value of
8585
/// `Select::wait()`
8686
id: usize,

branches/beta/src/libstd/sync/mpsc/stream.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const MAX_STEALS: isize = 5;
3939
#[cfg(not(test))]
4040
const MAX_STEALS: isize = 1 << 20;
4141

42-
pub struct Packet<T> {
42+
pub struct Packet<T:Send> {
4343
queue: spsc::Queue<Message<T>>, // internal queue for all message
4444

4545
cnt: AtomicIsize, // How many items are on this channel
@@ -49,7 +49,7 @@ pub struct Packet<T> {
4949
port_dropped: AtomicBool, // flag if the channel has been destroyed.
5050
}
5151

52-
pub enum Failure<T> {
52+
pub enum Failure<T:Send> {
5353
Empty,
5454
Disconnected,
5555
Upgraded(Receiver<T>),
@@ -61,15 +61,15 @@ pub enum UpgradeResult {
6161
UpWoke(SignalToken),
6262
}
6363

64-
pub enum SelectionResult<T> {
64+
pub enum SelectionResult<T:Send> {
6565
SelSuccess,
6666
SelCanceled,
6767
SelUpgraded(SignalToken, Receiver<T>),
6868
}
6969

7070
// Any message could contain an "upgrade request" to a new shared port, so the
7171
// internal queue it's a queue of T, but rather Message<T>
72-
enum Message<T> {
72+
enum Message<T:Send> {
7373
Data(T),
7474
GoUp(Receiver<T>),
7575
}

branches/beta/src/libstd/sys/common/helper_thread.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use thread;
3838
///
3939
/// The fields of this helper are all public, but they should not be used, this
4040
/// is for static initialization.
41-
pub struct Helper<M> {
41+
pub struct Helper<M:Send> {
4242
/// Internal lock which protects the remaining fields
4343
pub lock: StaticMutex,
4444
pub cond: StaticCondvar,

0 commit comments

Comments
 (0)