Skip to content

Commit

Permalink
Add a few trait impls for AccessError
Browse files Browse the repository at this point in the history
  • Loading branch information
Stjepan Glavina committed Jun 20, 2019
1 parent 3c805ce commit d6c3196
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libstd/thread/local.rs
Expand Up @@ -2,6 +2,7 @@

#![unstable(feature = "thread_local_internals", issue = "0")]

use crate::error::Error;
use crate::fmt;

/// A thread local storage key which owns its contents.
Expand Down Expand Up @@ -189,6 +190,7 @@ macro_rules! __thread_local_inner {

/// An error returned by [`LocalKey::try_with`](struct.LocalKey.html#method.try_with).
#[stable(feature = "thread_local_try_with", since = "1.26.0")]
#[derive(Clone, Copy, Eq, PartialEq)]
pub struct AccessError {
_private: (),
}
Expand All @@ -207,6 +209,8 @@ impl fmt::Display for AccessError {
}
}

impl Error for AccessError {}

impl<T: 'static> LocalKey<T> {
#[doc(hidden)]
#[unstable(feature = "thread_local_internals",
Expand Down

0 comments on commit d6c3196

Please sign in to comment.