Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a few trait impls for AccessError #61491

Merged
merged 2 commits into from Aug 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/libstd/thread/local.rs
Original file line number Diff line number Diff line change
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,9 @@ impl fmt::Display for AccessError {
}
}

#[stable(feature = "thread_local_try_with", since = "1.26.0")]
impl Error for AccessError {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll probably want a #[stable... attribute on this even though it does nothing today :)


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