The real reason to not use poisoning mutexes is convenience and developer experience. The standard library should take such considerations heavily into account. A rare use case such as poisoning being required should not be the default for mutexes in the standard library.
What does that even mean?
The interface concerns are as trivial as it gets:
#![feature(nonpoison_mutex)]
#![feature(sync_nonpoison)]
use std::sync::Mutex as PMutex;
use std::sync::nonpoison::Mutex as NoPMutex;
trait LockExt<'a> {
type Guard;
fn l(&'a self) -> Self::Guard;
}
impl<'a, T: 'a> LockExt<'a> for PMutex<T> {
type Guard = std::sync::MutexGuard<'a, T>;
fn l(&'a self) -> Self::Guard {
self.lock().expect("non-poisoned")
}
}
impl<'a, T: 'a> LockExt<'a> for NoPMutex<T> {
type Guard = std::sync::nonpoison::MutexGuard<'a, T>;
fn l(&'a self) -> Self::Guard {
self.lock()
}
}
fn main() {
let m_p = PMutex::new(false);
let m_no_p = NoPMutex::new(false);
*m_p.l() = true;
*m_no_p.l() = true;
dbg!(*m_p.l());
dbg!(*m_no_p.l());
}
This is basically is the one thing that shouldn't consume any mind tokens when it comes to synchronization primitive choice.