File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -697,7 +697,7 @@ impl Sealed for Bound<'_, PyArrayDescr> {}
697
697
///
698
698
/// [enumerated-types]: https://numpy.org/doc/stable/reference/c-api/dtype.html#enumerated-types
699
699
/// [data-models]: https://en.wikipedia.org/wiki/64-bit_computing#64-bit_data_models
700
- pub unsafe trait Element : Sized + Send {
700
+ pub unsafe trait Element : Sized + Send + Sync {
701
701
/// Flag that indicates whether this type is trivially copyable.
702
702
///
703
703
/// It should be set to true for all trivially copyable types (like scalar types
Original file line number Diff line number Diff line change @@ -14,8 +14,9 @@ pub(crate) struct PySliceContainer {
14
14
}
15
15
16
16
unsafe impl Send for PySliceContainer { }
17
+ unsafe impl Sync for PySliceContainer { }
17
18
18
- impl < T : Send > From < Box < [ T ] > > for PySliceContainer {
19
+ impl < T : Send + Sync > From < Box < [ T ] > > for PySliceContainer {
19
20
fn from ( data : Box < [ T ] > ) -> Self {
20
21
unsafe fn drop_boxed_slice < T > ( ptr : * mut u8 , len : usize , _cap : usize ) {
21
22
let _ = Box :: from_raw ( ptr:: slice_from_raw_parts_mut ( ptr as * mut T , len) ) ;
@@ -39,7 +40,7 @@ impl<T: Send> From<Box<[T]>> for PySliceContainer {
39
40
}
40
41
}
41
42
42
- impl < T : Send > From < Vec < T > > for PySliceContainer {
43
+ impl < T : Send + Sync > From < Vec < T > > for PySliceContainer {
43
44
fn from ( data : Vec < T > ) -> Self {
44
45
unsafe fn drop_vec < T > ( ptr : * mut u8 , len : usize , cap : usize ) {
45
46
let _ = Vec :: from_raw_parts ( ptr as * mut T , len, cap) ;
@@ -65,7 +66,7 @@ impl<T: Send> From<Vec<T>> for PySliceContainer {
65
66
66
67
impl < A , D > From < ArrayBase < OwnedRepr < A > , D > > for PySliceContainer
67
68
where
68
- A : Send ,
69
+ A : Send + Sync ,
69
70
D : Dimension ,
70
71
{
71
72
fn from ( data : ArrayBase < OwnedRepr < A > , D > ) -> Self {
You can’t perform that action at this time.
0 commit comments