about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-02-13 23:37:10 +0000
committerbors <bors@rust-lang.org>2016-02-13 23:37:10 +0000
commitfae516277b6da46b6c1cf568765c90fad2f9ae4b (patch)
treeeeac556e235e8f655e78c9613ad3da4deef0071d /src/libstd/sys
parent6e446532e835ed3c934eec5a98bb795c0ffd4e50 (diff)
parentb34e625faf5e195b900f92db1ac64b4d19e9b1c3 (diff)
downloadrust-fae516277b6da46b6c1cf568765c90fad2f9ae4b.tar.gz
rust-fae516277b6da46b6c1cf568765c90fad2f9ae4b.zip
Auto merge of #31643 - Manishearth:rollup, r=Manishearth
- Successful merges: #31535, #31537, #31542, #31559, #31563, #31582, #31584, #31585, #31589, #31607, #31609, #31610, #31612, #31629, #31635, #31637, #31638
- Failed merges:
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/common/poison.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/libstd/sys/common/poison.rs b/src/libstd/sys/common/poison.rs
index 2cfa04c843b..d858c002755 100644
--- a/src/libstd/sys/common/poison.rs
+++ b/src/libstd/sys/common/poison.rs
@@ -111,7 +111,7 @@ impl<T> fmt::Display for PoisonError<T> {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<T: Send + Reflect> Error for PoisonError<T> {
+impl<T: Reflect> Error for PoisonError<T> {
     fn description(&self) -> &str {
         "poisoned lock: another task failed inside"
     }
@@ -158,14 +158,17 @@ impl<T> fmt::Debug for TryLockError<T> {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<T: Send + Reflect> fmt::Display for TryLockError<T> {
+impl<T> fmt::Display for TryLockError<T> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        self.description().fmt(f)
+        match *self {
+            TryLockError::Poisoned(..) => "poisoned lock: another task failed inside",
+            TryLockError::WouldBlock => "try_lock failed because the operation would block"
+        }.fmt(f)
     }
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<T: Send + Reflect> Error for TryLockError<T> {
+impl<T: Reflect> Error for TryLockError<T> {
     fn description(&self) -> &str {
         match *self {
             TryLockError::Poisoned(ref p) => p.description(),