Skip to content

Commit f6ecdc2

Browse files
committed
Auto merge of #61491 - stjepang:impls-for-accesserror, r=dtolnay
Add a few trait impls for AccessError
2 parents 4be0675 + d2c9c12 commit f6ecdc2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libstd/thread/local.rs

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
#![unstable(feature = "thread_local_internals", issue = "0")]
44

5+
use crate::error::Error;
56
use crate::fmt;
67

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

190191
/// An error returned by [`LocalKey::try_with`](struct.LocalKey.html#method.try_with).
191192
#[stable(feature = "thread_local_try_with", since = "1.26.0")]
193+
#[derive(Clone, Copy, Eq, PartialEq)]
192194
pub struct AccessError {
193195
_private: (),
194196
}
@@ -207,6 +209,9 @@ impl fmt::Display for AccessError {
207209
}
208210
}
209211

212+
#[stable(feature = "thread_local_try_with", since = "1.26.0")]
213+
impl Error for AccessError {}
214+
210215
impl<T: 'static> LocalKey<T> {
211216
#[doc(hidden)]
212217
#[unstable(feature = "thread_local_internals",

0 commit comments

Comments
 (0)