diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs index 9b355aa2023ff..f85b5d632f16b 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,9 @@ impl fmt::Display for AccessError { } } +#[stable(feature = "thread_local_try_with", since = "1.26.0")] +impl Error for AccessError {} + impl LocalKey { #[doc(hidden)] #[unstable(feature = "thread_local_internals",