Closed steffahn closed 2 years ago
Similar issues with the Send
implementation and Sync
implementation of arc::Ref
, arc::RefMut
, arc::Strong
, and arc::Weak
. Compare the bounds in the standard library: https://doc.rust-lang.org/std/sync/struct.Arc.html#impl-Send
Ref: Send
case…Hi @steffahn!
Thanks for scrutinizing the library. It was a long time since I last touched it...
I believed I have fixed the unsoundness you reported. Could you review the patches to see if they are correct before I release a new version? Thanks!
Looks good upon first inspection. I’ll have to inspect the role of M
in the arc to fully understand its role, but M: Send+Sync
is not going to be unsound, at most too conservative. So looks good to me, I guess.
It implements
Send
forRMBA<'_, T>
whenT: Send
, even though anRMBA
could actually contain a&T
, whereT: !Sync
.Example exploitation:
To fix this, the
Send
implementation should probably requireT: Send + Sync
.