You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function Atomic::fetch_update is only available for types that implement AtomInteger. However, it doesn't actually do any implicit integer operations like, say, fn fetch_add does — it explicitly leaves the update to a Rust closure that is restricted to safe operations on the data types. As such, the restriction is not needed, allowing fetch_update to be used on enum types, for example.
Here's my example that does not work with atomig as it is now:
Somehow I managed to unwatch my own repository 😲 I just now stumbled upon your comment by pure chance. Sorry for the delay!
The problem here is that fetch_update was not implemented for non-integer atomics in std for some time: rust-lang/rust#78639
This seems to be a simple oversight though. AtomicBool::fetch_update and AtomicPtr::fetch_update were already added and their stabilization hits stable with 1.53, in roughly three weeks. I will wait till then to properly fix this issue. I will let you know once I release the fix as 0.3.
The function
Atomic::fetch_update
is only available for types that implementAtomInteger
. However, it doesn't actually do any implicit integer operations like, say,fn fetch_add
does — it explicitly leaves the update to a Rust closure that is restricted to safe operations on the data types. As such, the restriction is not needed, allowingfetch_update
to be used onenum
types, for example.Here's my example that does not work with atomig as it is now:
The text was updated successfully, but these errors were encountered: