File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 8383 with :
8484 profile : minimal
8585 toolchain : 1.41.1
86+ default : true
8687 - name : Install maturin, poetry, and toml
8788 run : pip install maturin poetry toml
8889 - name : Create an isolated example directory
Original file line number Diff line number Diff line change @@ -62,12 +62,12 @@ where
6262 let ( strides, dim) = ( self . npy_strides ( ) , self . raw_dim ( ) ) ;
6363 let orig_ptr = self . as_ptr ( ) ;
6464 // Element of which size is 0 is not supported, but check it for future changes
65- let is_empty_or_size0 = self . is_empty ( ) || std:: mem:: size_of :: < Self :: Item > ( ) == 0 ;
65+ let is_empty_or_size0 = self . is_empty ( ) || std:: mem:: size_of :: < A > ( ) == 0 ;
6666 let vec = self . into_raw_vec ( ) ;
6767 let offset = if is_empty_or_size0 {
6868 0
6969 } else {
70- unsafe { orig_ptr . offset_from ( vec. as_ptr ( ) ) as usize }
70+ ( orig_ptr as usize - vec. as_ptr ( ) as usize ) / std :: mem :: size_of :: < A > ( )
7171 } ;
7272 let mut boxed_slice = vec. into_boxed_slice ( ) ;
7373 // data_ptr is not always the pointer to the 1st element.
You can’t perform that action at this time.
0 commit comments