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> {}
697697///
698698/// [enumerated-types]: https://numpy.org/doc/stable/reference/c-api/dtype.html#enumerated-types
699699/// [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 {
701701 /// Flag that indicates whether this type is trivially copyable.
702702 ///
703703 /// 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 {
1414}
1515
1616unsafe impl Send for PySliceContainer { }
17+ unsafe impl Sync for PySliceContainer { }
1718
18- impl < T : Send > From < Box < [ T ] > > for PySliceContainer {
19+ impl < T : Send + Sync > From < Box < [ T ] > > for PySliceContainer {
1920 fn from ( data : Box < [ T ] > ) -> Self {
2021 unsafe fn drop_boxed_slice < T > ( ptr : * mut u8 , len : usize , _cap : usize ) {
2122 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 {
3940 }
4041}
4142
42- impl < T : Send > From < Vec < T > > for PySliceContainer {
43+ impl < T : Send + Sync > From < Vec < T > > for PySliceContainer {
4344 fn from ( data : Vec < T > ) -> Self {
4445 unsafe fn drop_vec < T > ( ptr : * mut u8 , len : usize , cap : usize ) {
4546 let _ = Vec :: from_raw_parts ( ptr as * mut T , len, cap) ;
@@ -65,7 +66,7 @@ impl<T: Send> From<Vec<T>> for PySliceContainer {
6566
6667impl < A , D > From < ArrayBase < OwnedRepr < A > , D > > for PySliceContainer
6768where
68- A : Send ,
69+ A : Send + Sync ,
6970 D : Dimension ,
7071{
7172 fn from ( data : ArrayBase < OwnedRepr < A > , D > ) -> Self {
You can’t perform that action at this time.
0 commit comments