Use portable_atomics
Closed this issue · 3 comments
t-moe commented
When compiling musli for my no_std project using the (riscv32) esp32-c6 I get:
error[E0432]: unresolved imports `core::sync::atomic::AtomicI64`, `core::sync::atomic::AtomicU64`
--> /home/timo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/musli-0.0.92/src/impls.rs:13:39
|
13 | AtomicBool, AtomicI16, AtomicI32, AtomicI64, AtomicI8, AtomicIsize, AtomicU16, AtomicU32,
| ^^^^^^^^^ no `AtomicI64` in `sync::atomic`
14 | AtomicU64, AtomicU8, AtomicUsize,
| ^^^^^^^^^ no `AtomicU64` in `sync::atomic`
|
help: a similar name exists in the module
|
13 | AtomicBool, AtomicI16, AtomicI32, AtomicI32, AtomicI8, AtomicIsize, AtomicU16, AtomicU32,
| ~~~~~~~~~
help: a similar name exists in the module
|
14 | AtomicU32, AtomicU8, AtomicUsize,
| ~~~~~~~~~
Could we use portable-atomics instead of core::sync::atomic?
udoprog commented
Sure.
The impls should be gated over target_has_atomic
(PR incoming).
Are you interested in adding impls for portable_atomic
behind a feature flag? It's unlikely that project will adopt Musli now, so for now it needs to live in here.
t-moe commented
Ah yes you're right. feature-gating is enough. I don't need portable_atomics.
thank you
udoprog commented
Glad to hear it. I'll ship a new release with the fix. Please try it out!