You can wrap the error in sync_wrapper::SyncWrapper which provides a trivial into_inner function. SyncWrapper is always Sync, but you can't get a &T from a &SyncWrapper<T>
The main benefit of SyncWrapper compared to Arc<Mutex<_>> is performance, right?
I should have mentioned that performance isn't important here. The thread my crate is joining is a server, and it's very unlikely that the error will occur. And even if it does, end-users most likely will just report the error and exit.
My main "problem" with Arc<Mutex<_>> is that it seems very strange (I have never seen this before).
So would Arc<Mutex<_>> be indeed the best solution here? (To avoid an additional dependency).
If you want to avoid the dep then, you can probably get away with just Mutex (if you don't need to share the error). Otherwise yes, Arc<Mutex<_>> is the best option. But it's a tiny dep, so I wouldn't worry about it.