Use cfg(target_has_atomic) instead of hard coding which targets support atomics
bjorn3 opened this issue · 2 comments
This has been stable since 1.60.0: rust-lang/rust#93824 The hard coded list is bound to go out of sync with rustc, especially when new targets get added. In fact it is already wildly out of sync. You currently only disable 64-bit atomics for 32bit arm, powerpc and mips, but a lot more targets like riscv32, sparc and thumb also don't support them: https://github.com/crossbeam-rs/crossbeam/blob/5fd21b032388c2e418c7306ba6149e1881943c31/no_atomic.rs#L19-L78 As rustc itself depends on crossbeam, this means it isn't possible to build rustc for targets lacking some atomics until a new crossbeam release with those new targets. Using cfg(target_has_atomic) will immediately work.
This was rendered obsolete by zip-rs/zip2@9438bef.