/// is held. The precise semantics for when a lock is poisoned is documented on
/// each lock, but once a lock is poisoned then all future acquisitions will
/// return this error.
-#[derive(Show)]
#[stable]
pub struct PoisonError<T> {
guard: T,
/// An enumeration of possible errors which can occur while calling the
/// `try_lock` method.
-#[derive(Show)]
#[stable]
pub enum TryLockError<T> {
/// The lock could not be acquired because another task failed while holding
#[stable]
pub type TryLockResult<Guard> = Result<Guard, TryLockError<Guard>>;
+#[stable]
+impl<T> fmt::Debug for PoisonError<T> {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ "PoisonError { inner: .. }".fmt(f)
+ }
+}
+
#[stable]
impl<T> fmt::Display for PoisonError<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
}
}
+#[stable]
+impl<T> fmt::Debug for TryLockError<T> {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ match *self {
+ TryLockError::Poisoned(..) => "Poisoned(..)".fmt(f),
+ TryLockError::WouldBlock => "WouldBlock".fmt(f)
+ }
+ }
+}
+
#[stable]
impl<T> fmt::Display for TryLockError<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {