File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -4578,8 +4578,8 @@ impl<T> [T] {
45784578 panic ! ( "elements are zero-sized" ) ;
45794579 }
45804580
4581- let self_start = self . as_ptr ( ) as usize ;
4582- let elem_start = element as * const T as usize ;
4581+ let self_start = self . as_ptr ( ) . addr ( ) ;
4582+ let elem_start = ptr :: from_ref ( element) . addr ( ) ;
45834583
45844584 let byte_offset = elem_start. wrapping_sub ( self_start) ;
45854585
@@ -4631,8 +4631,8 @@ impl<T> [T] {
46314631 panic ! ( "elements are zero-sized" ) ;
46324632 }
46334633
4634- let self_start = self . as_ptr ( ) as usize ;
4635- let subslice_start = subslice. as_ptr ( ) as usize ;
4634+ let self_start = self . as_ptr ( ) . addr ( ) ;
4635+ let subslice_start = subslice. as_ptr ( ) . addr ( ) ;
46364636
46374637 let byte_start = subslice_start. wrapping_sub ( self_start) ;
46384638
You can’t perform that action at this time.
0 commit comments