Yuki Okushi
796bc7cae3
Rollup merge of #98383 - m-ou-se:remove-memory-order-restrictions, r=joshtriplett
Remove restrictions on compare-exchange memory ordering.
We currently don't allow the failure memory ordering of compare-exchange operations to be stronger than the success ordering, as was the case in C++11 when its memory model was copied to Rust. However, this restriction was lifted in C++17 as part of [p0418r2](https://wg21.link/p0418r2). It's time we lift the restriction too.
| Success | Failure | Before | After |
|---------|---------|--------|-------|
| Relaxed | Relaxed | ✔️ | ✔️ |
| Relaxed | Acquire | ❌ | ✔️ |
| Relaxed | SeqCst | ❌ | ✔️ |
| Acquire | Relaxed | ✔️ | ✔️ |
| Acquire | Acquire | ✔️ | ✔️ |
| Acquire | SeqCst | ❌ | ✔️ |
| Release | Relaxed | ✔️ | ✔️ |
| Release | Acquire | ❌ | ✔️ |
| Release | SeqCst | ❌ | ✔️ |
| AcqRel | Relaxed | ✔️ | ✔️ |
| AcqRel | Acquire | ✔️ | ✔️ |
| AcqRel | SeqCst | ❌ | ✔️ |
| SeqCst | Relaxed | ✔️ | ✔️ |
| SeqCst | Acquire | ✔️ | ✔️ |
| SeqCst | SeqCst | ✔️ | ✔️ |
| \* | Release | ❌ | ❌ |
| \* | AcqRel | ❌ | ❌ |
Fixes https://github.com/rust-lang/rust/issues/68464
2022-07-18 08:39:57 +09:00
..
2022-05-31 10:51:35 +02:00
2021-09-12 02:23:08 +00:00
2022-07-18 08:39:57 +09:00
2022-07-17 13:08:52 +09:00
2022-05-02 00:08:21 -07:00