-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Implement RFC 909: move thread_local into thread #23557
Conversation
cc @carllerche |
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
#[unstable(feature = "std_misc")] | ||
#[deprecated(since = "1.0.0", reason = "use std::thread::ScopedKey instead")] | ||
/// Deprecated: use `std::threaed::ScopedKey` instead. | ||
pub use thread::ScopedKey as Key; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to pub use
not actually issuing deprecation warnings, and the fact that this is such a relatively rarely imported module, I'd be fine just deleting this module.
Comments addressed. Thanks! |
@bors: r+ 218b5abf5f703555d50833af6bd3fd966c8901f6 |
@bors: r=alexcrichton 6143776 |
☔ The latest upstream changes (presumably #23512) made this pull request unmergeable. Please resolve the merge conflicts. |
🔒 Merge conflict |
@@ -156,6 +190,22 @@ use time::Duration; | |||
use sys::thread as imp; | |||
use sys_common::{stack, thread_info}; | |||
|
|||
//////////////////////////////////////////////////////////////////////////////// | |||
// Thread-local storage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t like these comments as they usually suggest the file is getting too big and should be split into more, instead of adding such comments.
This commit implements [RFC 909](rust-lang/rfcs#909): The `std::thread_local` module is now deprecated, and its contents are available directly in `std::thread` as `LocalKey`, `LocalKeyState`, and `ScopedKey`. The macros remain exactly as they were, which means little if any code should break. Nevertheless, this is technically a: [breaking-change] Closes rust-lang#23547
This commit implements [RFC 909](rust-lang/rfcs#909): The `std::thread_local` module is now deprecated, and its contents are available directly in `std::thread` as `LocalKey`, `LocalKeyState`, and `ScopedKey`. The macros remain exactly as they were, which means little if any code should break. Nevertheless, this is technically a: [breaking-change] Closes rust-lang#23547
This commit implements RFC 909:
The
std::thread_local
module is now deprecated, and its contents areavailable directly in
std::thread
asLocalKey
,LocalKeyState
, andScopedKey
.The macros remain exactly as they were, which means little if any code
should break. Nevertheless, this is technically a:
[breaking-change]
Closes #23547