-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Remove the UnsafeArc type #14301
Remove the UnsafeArc type #14301
Conversation
This also removes the `&mut self` requirement, using the correct `&self` requirement for concurrent types.
This removes usage of UnsafeArc and uses proper self mutability for concurrent types.
This removes the incorrect `&mut self` taken because it can alias among many threads.
This removes the incorrect usage of `&mut self` in a concurrent setting.
This removes the usage of UnsafeArc
They currently still use `&mut self`, this migration was aimed towards moving from UnsafeArc<T> to Arc<Unsafe<T>>
This type has been superseded by Arc<Unsafe<T>>. The UnsafeArc type is a relic of an era that has long since past, and with the introduction of liballoc the standard library is able to use the Arc smart pointer. With little need left for UnsafeArc, it was removed. All existing code using UnsafeArc should either be reevaluated to whether it can use only Arc, or it should transition to Arc<Unsafe<T>> [breaking-change]
I guess that comment applies generally, not just to the first commit. All of the types that you're enabling mutation through |
These types are no more or less safe than they were before, because they were impossible to safely be used in a shared context (all methods took I'm currently debugging a crash which is caused by this. |
@alexcrichton Right, but they took |
It's not very helpful for concurrent queues to be |
I've been anticipating this day for so long! |
@alexcrichton I was thinking more along the lines of |
Managed to fix the crash I was seeing, and I marked the types that did the work of being split into halves to have each half marked as Build is still running, but should be good for a go now. |
This type can be built with `Arc<Unsafe<T>>` now that liballoc exists.
This type can be built with
Arc<Unsafe<T>>
now that liballoc exists.