SharedString and SharedVector should be Send

SharedString used to be Send, but this regress when we moved the implementation
over to SharedVector.
This regression was cought trying to compile CargoUI with master
This commit is contained in:
Olivier Goffart 2021-12-12 15:01:41 +01:00
parent dc7942fa86
commit 9440d3c003
2 changed files with 35 additions and 0 deletions

View file

@ -86,6 +86,9 @@ pub struct SharedVector<T> {
inner: NonNull<SharedVectorInner<T>>,
}
// Safety: We use atomic reference counting, and if T is Send, we can send the vector to another thread
unsafe impl<T: Send> Send for SharedVector<T> {}
impl<T> Drop for SharedVector<T> {
fn drop(&mut self) {
unsafe {