about summary refs log tree commit diff
diff options
context:
space:
mode:
authorStjepan Glavina <stjepang@gmail.com>2019-06-03 18:20:38 +0200
committerStjepan Glavina <stjepang@gmail.com>2019-06-20 09:30:45 +0200
commitd6c3196d02c88887491433b31d92221d0ef0fa43 (patch)
treec3617296a301f751c6501227c6363180482d4418
parent3c805ce183840bd20bd81a54a02b3c8b6dccc9dd (diff)
downloadrust-d6c3196d02c88887491433b31d92221d0ef0fa43.tar.gz
rust-d6c3196d02c88887491433b31d92221d0ef0fa43.zip
Add a few trait impls for AccessError
-rw-r--r--src/libstd/thread/local.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs
index 9b355aa2023..d64483c5ac1 100644
--- a/src/libstd/thread/local.rs
+++ b/src/libstd/thread/local.rs
@@ -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.
@@ -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: (),
 }
@@ -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",