Auto merge of #61491 - stjepang:impls-for-accesserror, r=dtolnay

Add a few trait impls for AccessError
This commit is contained in:
bors 2019-08-05 15:30:40 +00:00
commit f6ecdc2f61

View file

@ -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 @@ unsafe fn __getit() -> $crate::option::Option<&'static $t> {
/// 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 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
}
}
#[stable(feature = "thread_local_try_with", since = "1.26.0")]
impl Error for AccessError {}
impl<T: 'static> LocalKey<T> {
#[doc(hidden)]
#[unstable(feature = "thread_local_internals",