Skip to content

Commit c404b8b

Browse files
author
bors-servo
committed
Auto merge of #20 - tomaka:patch-1, r=pcwalton
Implement Send and Sync on SmallVec Because of the core team's questionable decision of not implementing Send and Sync on raw pointers, we need to implement them manually. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-smallvec/20) <!-- Reviewable:end -->
2 parents 091f712 + 5ece9b2 commit c404b8b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ enum SmallVecData<A: Array> {
8383
Heap { ptr: *mut A::Item, capacity: usize },
8484
}
8585

86+
unsafe impl<A: Array + Send> Send for SmallVecData<A> {}
87+
unsafe impl<A: Array + Sync> Sync for SmallVecData<A> {}
88+
8689
impl<A: Array> Drop for SmallVecData<A> {
8790
fn drop(&mut self) {
8891
unsafe {

0 commit comments

Comments
 (0)