diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2015-11-16 19:54:28 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2015-11-18 01:24:21 +0300 |
| commit | 7e2ffc7090a70fe8c77a0e03fcec3cb1387141f2 (patch) | |
| tree | 63f67955eac7b8d88a7a771a958948500d4d9f15 /src/libstd/sync/mpsc | |
| parent | 52acc05f6398d70e8cc506e19bb9fefbed7368ac (diff) | |
| download | rust-7e2ffc7090a70fe8c77a0e03fcec3cb1387141f2.tar.gz rust-7e2ffc7090a70fe8c77a0e03fcec3cb1387141f2.zip | |
Add missing annotations and some tests
Diffstat (limited to 'src/libstd/sync/mpsc')
| -rw-r--r-- | src/libstd/sync/mpsc/mod.rs | 6 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/mpsc_queue.rs | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index a0d0147296a..e87ae19c583 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -272,6 +272,7 @@ use mem; use cell::UnsafeCell; use marker::Reflect; +#[unstable(feature = "mpsc_select", issue = "27800")] pub use self::select::{Select, Handle}; use self::select::StartResult; use self::select::StartResult::*; @@ -295,6 +296,7 @@ pub struct Receiver<T> { // The receiver port can be sent from place to place, so long as it // is not used to receive non-sendable things. +#[stable(feature = "rust1", since = "1.0.0")] unsafe impl<T: Send> Send for Receiver<T> { } /// An iterator over messages on a receiver, this iterator will block @@ -322,6 +324,7 @@ pub struct Sender<T> { // The send port can be sent from place to place, so long as it // is not used to send non-sendable things. +#[stable(feature = "rust1", since = "1.0.0")] unsafe impl<T: Send> Send for Sender<T> { } /// The sending-half of Rust's synchronous channel type. This half can only be @@ -331,8 +334,10 @@ pub struct SyncSender<T> { inner: Arc<UnsafeCell<sync::Packet<T>>>, } +#[stable(feature = "rust1", since = "1.0.0")] unsafe impl<T: Send> Send for SyncSender<T> {} +#[stable(feature = "rust1", since = "1.0.0")] impl<T> !Sync for SyncSender<T> {} /// An error returned from the `send` function on channels. @@ -954,6 +959,7 @@ impl<'a, T> IntoIterator for &'a Receiver<T> { fn into_iter(self) -> Iter<'a, T> { self.iter() } } +#[stable(feature = "receiver_into_iter", since = "1.1.0")] impl<T> Iterator for IntoIter<T> { type Item = T; fn next(&mut self) -> Option<T> { self.rx.recv().ok() } diff --git a/src/libstd/sync/mpsc/mpsc_queue.rs b/src/libstd/sync/mpsc/mpsc_queue.rs index e4eba3d3d20..6a6c19cfcc3 100644 --- a/src/libstd/sync/mpsc/mpsc_queue.rs +++ b/src/libstd/sync/mpsc/mpsc_queue.rs @@ -133,7 +133,6 @@ impl<T> Queue<T> { } } -#[stable(feature = "rust1", since = "1.0.0")] impl<T> Drop for Queue<T> { fn drop(&mut self) { unsafe { |
