about summary refs log tree commit diff
path: root/src/libstd/sync
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-03-24 17:38:09 +0000
committerbors <bors@rust-lang.org>2015-03-24 17:38:09 +0000
commited810385045ab0db90303574ba3ea47dfa2a36d5 (patch)
tree161242c800aca625a26c56551fa5adb446c0089f /src/libstd/sync
parent28a0b25f424090255966273994748a9f9901059f (diff)
parentd252d0ad5434bcf77076729ab766eeff98f20ead (diff)
downloadrust-ed810385045ab0db90303574ba3ea47dfa2a36d5.tar.gz
rust-ed810385045ab0db90303574ba3ea47dfa2a36d5.zip
Auto merge of #23654 - alexcrichton:rollup, r=alexcrichton
Diffstat (limited to 'src/libstd/sync')
-rw-r--r--src/libstd/sync/condvar.rs1
-rw-r--r--src/libstd/sync/future.rs1
-rw-r--r--src/libstd/sync/mpsc/mod.rs6
-rw-r--r--src/libstd/sync/mpsc/select.rs2
-rw-r--r--src/libstd/sync/mutex.rs2
-rw-r--r--src/libstd/sync/poison.rs8
-rw-r--r--src/libstd/sync/rwlock.rs1
-rw-r--r--src/libstd/sync/semaphore.rs1
-rw-r--r--src/libstd/sync/task_pool.rs1
9 files changed, 17 insertions, 6 deletions
diff --git a/src/libstd/sync/condvar.rs b/src/libstd/sync/condvar.rs
index 4430cc3b0af..69c5267ab69 100644
--- a/src/libstd/sync/condvar.rs
+++ b/src/libstd/sync/condvar.rs
@@ -69,6 +69,7 @@ pub struct Condvar { inner: Box<StaticCondvar> }
 /// # Examples
 ///
 /// ```
+/// # #![feature(std_misc)]
 /// use std::sync::{StaticCondvar, CONDVAR_INIT};
 ///
 /// static CVAR: StaticCondvar = CONDVAR_INIT;
diff --git a/src/libstd/sync/future.rs b/src/libstd/sync/future.rs
index ee9bcd3dd89..3c7fecb7515 100644
--- a/src/libstd/sync/future.rs
+++ b/src/libstd/sync/future.rs
@@ -14,6 +14,7 @@
 //! # Examples
 //!
 //! ```
+//! # #![feature(std_misc)]
 //! use std::sync::Future;
 //!
 //! // a fake, for now
diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs
index 123dad978f5..7adfd9154ac 100644
--- a/src/libstd/sync/mpsc/mod.rs
+++ b/src/libstd/sync/mpsc/mod.rs
@@ -119,6 +119,7 @@
 //! after 10 seconds no matter what:
 //!
 //! ```no_run
+//! # #![feature(std_misc, old_io)]
 //! use std::sync::mpsc::channel;
 //! use std::old_io::timer::Timer;
 //! use std::time::Duration;
@@ -143,6 +144,7 @@
 //! has been inactive for 5 seconds:
 //!
 //! ```no_run
+//! # #![feature(std_misc, old_io)]
 //! use std::sync::mpsc::channel;
 //! use std::old_io::timer::Timer;
 //! use std::time::Duration;
@@ -977,7 +979,7 @@ impl<T> fmt::Display for SendError<T> {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<T> error::Error for SendError<T> {
+impl<T: Send> error::Error for SendError<T> {
 
     fn description(&self) -> &str {
         "sending on a closed channel"
@@ -1013,7 +1015,7 @@ impl<T> fmt::Display for TrySendError<T> {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<T> error::Error for TrySendError<T> {
+impl<T: Send> error::Error for TrySendError<T> {
 
     fn description(&self) -> &str {
         match *self {
diff --git a/src/libstd/sync/mpsc/select.rs b/src/libstd/sync/mpsc/select.rs
index b5739c36aa9..0f936641cdc 100644
--- a/src/libstd/sync/mpsc/select.rs
+++ b/src/libstd/sync/mpsc/select.rs
@@ -27,6 +27,7 @@
 //! # Examples
 //!
 //! ```rust
+//! # #![feature(std_misc)]
 //! use std::sync::mpsc::channel;
 //!
 //! let (tx1, rx1) = channel();
@@ -119,6 +120,7 @@ impl Select {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::sync::mpsc::Select;
     ///
     /// let select = Select::new();
diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs
index 130fd1d7dc8..2bf75cf1d37 100644
--- a/src/libstd/sync/mutex.rs
+++ b/src/libstd/sync/mutex.rs
@@ -85,6 +85,7 @@ use fmt;
 /// To recover from a poisoned mutex:
 ///
 /// ```
+/// # #![feature(std_misc)]
 /// use std::sync::{Arc, Mutex};
 /// use std::thread;
 ///
@@ -136,6 +137,7 @@ unsafe impl<T: Send> Sync for Mutex<T> { }
 /// # Examples
 ///
 /// ```
+/// # #![feature(std_misc)]
 /// use std::sync::{StaticMutex, MUTEX_INIT};
 ///
 /// static LOCK: StaticMutex = MUTEX_INIT;
diff --git a/src/libstd/sync/poison.rs b/src/libstd/sync/poison.rs
index 2587ff5238e..c07c83d37f4 100644
--- a/src/libstd/sync/poison.rs
+++ b/src/libstd/sync/poison.rs
@@ -105,11 +105,11 @@ impl<T> fmt::Debug for PoisonError<T> {
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> fmt::Display for PoisonError<T> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        self.description().fmt(f)
+        "poisoned lock: another task failed inside".fmt(f)
     }
 }
 
-impl<T> Error for PoisonError<T> {
+impl<T: Send> Error for PoisonError<T> {
     fn description(&self) -> &str {
         "poisoned lock: another task failed inside"
     }
@@ -161,13 +161,13 @@ impl<T> fmt::Debug for TryLockError<T> {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<T> fmt::Display for TryLockError<T> {
+impl<T: Send> fmt::Display for TryLockError<T> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         self.description().fmt(f)
     }
 }
 
-impl<T> Error for TryLockError<T> {
+impl<T: Send> Error for TryLockError<T> {
     fn description(&self) -> &str {
         match *self {
             TryLockError::Poisoned(ref p) => p.description(),
diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs
index 368e88e4e8b..6e94db6d753 100644
--- a/src/libstd/sync/rwlock.rs
+++ b/src/libstd/sync/rwlock.rs
@@ -77,6 +77,7 @@ unsafe impl<T: Send + Sync> Sync for RwLock<T> {}
 /// # Examples
 ///
 /// ```
+/// # #![feature(std_misc)]
 /// use std::sync::{StaticRwLock, RW_LOCK_INIT};
 ///
 /// static LOCK: StaticRwLock = RW_LOCK_INIT;
diff --git a/src/libstd/sync/semaphore.rs b/src/libstd/sync/semaphore.rs
index 2f9873950b6..059cce57245 100644
--- a/src/libstd/sync/semaphore.rs
+++ b/src/libstd/sync/semaphore.rs
@@ -25,6 +25,7 @@ use sync::{Mutex, Condvar};
 /// # Examples
 ///
 /// ```
+/// # #![feature(std_misc)]
 /// use std::sync::Semaphore;
 ///
 /// // Create a semaphore that represents 5 resources
diff --git a/src/libstd/sync/task_pool.rs b/src/libstd/sync/task_pool.rs
index 8a1946b86ab..51cf70e615b 100644
--- a/src/libstd/sync/task_pool.rs
+++ b/src/libstd/sync/task_pool.rs
@@ -61,6 +61,7 @@ impl<'a> Drop for Sentinel<'a> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(std_misc, core)]
 /// use std::sync::TaskPool;
 /// use std::iter::AdditiveIterator;
 /// use std::sync::mpsc::channel;