compare_exchange on atomic types in Rust with release as success and acquire on failure ordering is not permitted and will fail because "a failure ordering can't be stronger than a success ordering".
Digging around in the LLVM references I found this quote:
The success and failure ordering arguments specify how this
cmpxchgsynchronizes with other atomic operations. Both ordering parameters must be at least
monotonic, the ordering constraint on failure must be no stronger than that on success, and the failure ordering cannot be either
However, I don't see why this should include release/acquire ordering. Neither of those is stronger than the other and I've come across some cases where this would be the correct ordering in my assessment. In these cases I would either use acquire-release/acquire ordering or release/relaxed and an acquire fence in the failure branch.