@@ -2703,7 +2703,7 @@ impl<T> Iterator for IntoIter<T> {
2703
2703
// purposefully don't use 'ptr.offset' because for
2704
2704
// vectors with 0-size elements this would return the
2705
2705
// same pointer.
2706
- self . ptr = unsafe { arith_offset ( self . ptr as * const T , 1 ) as * mut T } ;
2706
+ self . ptr = unsafe { arith_offset ( self . ptr as * const i8 , 1 ) as * mut T } ;
2707
2707
2708
2708
// Make up a value of this ZST.
2709
2709
Some ( unsafe { mem:: zeroed ( ) } )
@@ -2735,22 +2735,18 @@ impl<T> Iterator for IntoIter<T> {
2735
2735
impl < T > DoubleEndedIterator for IntoIter < T > {
2736
2736
#[ inline]
2737
2737
fn next_back ( & mut self ) -> Option < T > {
2738
- unsafe {
2739
- if self . end == self . ptr {
2740
- None
2741
- } else {
2742
- if mem:: size_of :: < T > ( ) == 0 {
2743
- // See above for why 'ptr.offset' isn't used
2744
- self . end = arith_offset ( self . end as * const i8 , -1 ) as * mut T ;
2738
+ if self . end == self . ptr {
2739
+ None
2740
+ } else if mem:: size_of :: < T > ( ) == 0 {
2741
+ // See above for why 'ptr.offset' isn't used
2742
+ self . end = unsafe { arith_offset ( self . end as * const i8 , -1 ) as * mut T } ;
2745
2743
2746
- // Make up a value of this ZST.
2747
- Some ( mem:: zeroed ( ) )
2748
- } else {
2749
- self . end = self . end . offset ( -1 ) ;
2744
+ // Make up a value of this ZST.
2745
+ Some ( unsafe { mem:: zeroed ( ) } )
2746
+ } else {
2747
+ self . end = unsafe { self . end . offset ( -1 ) } ;
2750
2748
2751
- Some ( ptr:: read ( self . end ) )
2752
- }
2753
- }
2749
+ Some ( unsafe { ptr:: read ( self . end ) } )
2754
2750
}
2755
2751
}
2756
2752
}
0 commit comments