-
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
Tracking issue for thread local Cell methods #92122
Comments
…joshtriplett Implement RFC 3184 - thread local cell methods This implements [RFC 3184](rust-lang/rfcs#3184), with `@danielhenrymantilla's` [suggestion](rust-lang/rfcs#3184 (comment)) for the `with_` method names. Tracking issue: rust-lang#92122
Hello, |
Nominated this for discussion in the next libs-api meeting. I believe the only remaining point of discussion is the behaviour of The thread_local! {
static ID: Cell<i32> = panic!("ID not set on this thread!");
}
fn main() {
ID.set(123); // OK, no panic.
println!("{}", ID.get()); // OK, no panic now that it has been set.
} |
Awesome ! And thank you for your answer. |
@rfcbot merge |
Team member @m-ou-se has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
Was there any specific resolution on this? (I have no qualms, just wondering for completeness) |
Initially, not everyone was convinced this was a good idea. Some thought that making |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
Feature gate:
#![feature(local_key_cell_methods)]
This is a tracking issue for thread local Cell methods: RFC 3184.
Public API
Steps / History
Unresolved Questions
Is the behavior ofYes.set()
(to skip the default initialization) the right behavior?UnsafeCell
? MaybeLocalKey<UnsafeCell<T>>::get()
to get the*mut T
, just likeUnsafeCell<T>::get()
.The text was updated successfully, but these errors were encountered: