diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2016-02-14 03:59:10 +0530 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2016-02-14 05:06:34 +0530 |
| commit | 8a5ec51eff3a0c441cbd2654d873f610101cd6ef (patch) | |
| tree | f506ebe990378c79d9b7dea6f68191bf536c196e /src/libstd/sys/common | |
| parent | f1f6db688b4bff1ac1d6763d50f7ff3e83d5cd6a (diff) | |
| parent | 8bbb70cb94bfbe485e94994b2da35675597586c6 (diff) | |
| download | rust-8a5ec51eff3a0c441cbd2654d873f610101cd6ef.tar.gz rust-8a5ec51eff3a0c441cbd2654d873f610101cd6ef.zip | |
Rollup merge of #31589 - reem:remove-unnecessary-poison-bounds, r=sfackler
None
Diffstat (limited to 'src/libstd/sys/common')
| -rw-r--r-- | src/libstd/sys/common/poison.rs | 11 |
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(), |
