-
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
Safe version of UnsafeArc that accepts only atomic types #10112
Comments
this is a low-priority post-1.0-compatible enhancement |
Closing, this is handled with |
is that safe with |
It is indeed, all of the atomics have changed to taking |
I mean... didn't |
There's no longer any way to borrow an |
huh, so if you want to put a |
The |
Oh yeah, that's the one I meant. So there's no |
It is indeed gone: http://static.rust-lang.org/doc/master/std/sync/atomics/struct.AtomicOption.html Only atomic operations are exposed (getting/setting/taking/etc) |
[arithmetic-side-effects] Consider negative numbers and add more tests Same as rust-lang#9867. Opening again because it is not possible to randomly choose a reviewer in an ongoing PR like in the rust repo. --- changelog: PF: [`arithmetic_side_effects`]: No longer lints on corner cases with negative number literals [rust-lang#9867](rust-lang/rust-clippy#9867) <!-- changelog_checked -->
To share data such as counters cross-task, you either have to use the performance-impacting RWArc or litter your code with unsafe using an UnsafeArc. If all you want to be doing cross-task is atomically incrementing counters or shuffling AtomicOptions around, it would be safe to avoid the RWArc's overhead.
To do generally, this would require a new
Atomic
kind, which would be introduced with unsafe attributes in the atomics library and could be derived by other aggregate types that contained only atomics (but NOT enums).The text was updated successfully, but these errors were encountered: