I was looking at the documentation for AtomicU8::compare_exchange and noticed that there was a very specific set of instructions on what is allowed in terms of the
I would imagine that the use of this would be made better if such things were checked at compile time. This is also not the only place that such compile checks would be nice to have.
Therefore I ask: is there any desire to have such checks be, at least in part, possible?
What I am imagining are some sort of annotations, sort of like
where clauses that are attempted at compile time. To facilitate this, we could also make calling functions with these checks
unsafe if the compiler cannot guarantee that it checks out.
std::cmp::Ord is implemented for
pub fn compare_exchange( &self, current: u8, new: u8, success: Ordering, failure: Ordering ) -> Result<u8, u8> where success >= failure, failure == Ordering::SeqCst || failure == Ordering::Acquire || failure == Ordering::Relaxed