-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Some targets do not offer all atomic features used in core::sync::atomic
. On those targets, the standard library just does not have specific types or methods. This is problematic for atomig
, as those types/methods are referred to anyway, even if a user of atomig
would not use them. So in order for atomig
to compile on those targets, we need to #[cfg]
guard types and methods appropriately.
Unfortunately, the cfg checks that are available on stable are not super powerful yet. There is only target_has_atomic = *
where *
can be a size like 8, 16, ... and "ptr". This already helped somewhat and made atomig
compile for targets like thumbv7em-none-eabi
. But other targets need more fine-grained control. For example, compiling for thumbv6m-none-eabi
results in no Atom
implementations at all. So we are waiting for stuff like:
target_has_atomic_load_store
Tracking Issue for cfg(target_has_atomic_load_store) rust-lang/rust#94039- ...