File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -285,12 +285,12 @@ impl<T> SliceExt for [T] {
285285
286286 #[ inline]
287287 unsafe fn get_unchecked ( & self , index : usize ) -> & T {
288- & * ( self . repr ( ) . data . offset ( index as isize ) )
288+ & * ( self . as_ptr ( ) . offset ( index as isize ) )
289289 }
290290
291291 #[ inline]
292292 fn as_ptr ( & self ) -> * const T {
293- self . repr ( ) . data
293+ self as * const [ T ] as * const T
294294 }
295295
296296 fn binary_search_by < F > ( & self , mut f : F ) -> Result < usize , usize > where
@@ -448,12 +448,12 @@ impl<T> SliceExt for [T] {
448448
449449 #[ inline]
450450 unsafe fn get_unchecked_mut ( & mut self , index : usize ) -> & mut T {
451- & mut * ( self . repr ( ) . data as * mut T ) . offset ( index as isize )
451+ & mut * self . as_mut_ptr ( ) . offset ( index as isize )
452452 }
453453
454454 #[ inline]
455455 fn as_mut_ptr ( & mut self ) -> * mut T {
456- self . repr ( ) . data as * mut T
456+ self as * mut [ T ] as * mut T
457457 }
458458
459459 #[ inline]
Original file line number Diff line number Diff line change @@ -1894,7 +1894,7 @@ impl StrExt for str {
18941894
18951895 #[ inline]
18961896 fn as_ptr ( & self ) -> * const u8 {
1897- self . repr ( ) . data
1897+ self as * const str as * const u8
18981898 }
18991899
19001900 #[ inline]
You can’t perform that action at this time.
0 commit comments