File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -2410,8 +2410,8 @@ impl<T> Iterator for IntoIter<T> {
2410
2410
// same pointer.
2411
2411
self . ptr = arith_offset ( self . ptr as * const i8 , 1 ) as * mut T ;
2412
2412
2413
- // Read from a properly aligned pointer to make up a value of this ZST.
2414
- Some ( ptr :: read ( NonNull :: dangling ( ) . as_ptr ( ) ) )
2413
+ // Make up a value of this ZST.
2414
+ Some ( mem :: zeroed ( ) )
2415
2415
} else {
2416
2416
let old = self . ptr ;
2417
2417
self . ptr = self . ptr . offset ( 1 ) ;
@@ -2450,8 +2450,8 @@ impl<T> DoubleEndedIterator for IntoIter<T> {
2450
2450
// See above for why 'ptr.offset' isn't used
2451
2451
self . end = arith_offset ( self . end as * const i8 , -1 ) as * mut T ;
2452
2452
2453
- // Read from a properly aligned pointer to make up a value of this ZST.
2454
- Some ( ptr :: read ( NonNull :: dangling ( ) . as_ptr ( ) ) )
2453
+ // Make up a value of this ZST.
2454
+ Some ( mem :: zeroed ( ) )
2455
2455
} else {
2456
2456
self . end = self . end . offset ( -1 ) ;
2457
2457
You can’t perform that action at this time.
0 commit comments