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 83
83
with :
84
84
profile : minimal
85
85
toolchain : 1.41.1
86
+ default : true
86
87
- name : Install maturin, poetry, and toml
87
88
run : pip install maturin poetry toml
88
89
- name : Create an isolated example directory
Original file line number Diff line number Diff line change @@ -62,12 +62,12 @@ where
62
62
let ( strides, dim) = ( self . npy_strides ( ) , self . raw_dim ( ) ) ;
63
63
let orig_ptr = self . as_ptr ( ) ;
64
64
// 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 ;
66
66
let vec = self . into_raw_vec ( ) ;
67
67
let offset = if is_empty_or_size0 {
68
68
0
69
69
} 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 > ( )
71
71
} ;
72
72
let mut boxed_slice = vec. into_boxed_slice ( ) ;
73
73
// data_ptr is not always the pointer to the 1st element.
You can’t perform that action at this time.
0 commit comments