Unsound `Send`/`Sync` of `ArcBorrow`.
steffahn opened this issue · 0 comments
steffahn commented
Currently, the implicit
impl<'a, T: ?Sized> Send for ArcBorrow<'a, T>
where
T: Sync,
impl<'a, T: ?Sized> Sync for ArcBorrow<'a, T>
where
T: Sync,
don’t match the implementations for &Arc<T>
. This is unsound, as T: Send + Sync
(not just T: Sync
) is essential for payloads dropped in a different thread than the one creating the Arc
, as well as for APIs such as Arc::get_mut
, etc…
For #65, ArcBorrow
needs to be changed anyways, so I suppose this could be fixed at the same time. Of course, that’s then technically a breaking change, but also a soundness fix.