File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ impl<T> PolymorphicIter<[MaybeUninit<T>]> {
180180 func ( self . alive . clone ( ) . next ( ) . map ( |idx| {
181181 // SAFETY: `idx` is in self.alive range
182182 unsafe { self . data . get_unchecked ( idx) . assume_init_ref ( ) }
183- } ) ) ;
183+ } ) )
184184 }
185185
186186 #[ inline]
Original file line number Diff line number Diff line change @@ -471,7 +471,6 @@ macro_rules! iterator {
471471 #[ unstable( feature = "peekable_iterator" , issue = "132973" ) ]
472472 impl <' a, T > PeekableIterator for $name<' a, T > {
473473 fn peek_with<U >( & mut self , func: impl for <' b> FnOnce ( Option <& ' b Self :: Item >) -> U ) -> U {
474- let ptr = self . ptr;
475474 let end_or_len = self . end_or_len;
476475
477476 // SAFETY: See inner comments.
@@ -482,14 +481,13 @@ macro_rules! iterator {
482481 return func( None ) ;
483482 }
484483 } else {
485- if ptr . as_ptr ( ) == end_or_len {
484+ if self . ptr == crate :: intrinsics :: transmute :: <$ptr , NonNull < T >> ( end_or_len) {
486485 return func( None ) ;
487486 }
488487 }
489488 // SAFETY: Now that we know it wasn't empty
490489 // we can give out a reference to it.
491- let tmp = ptr. $into_ref( ) ;
492- func( Some ( & tmp) )
490+ func( Some ( self . ptr. $into_ref( ) ) . as_ref( ) )
493491 }
494492 }
495493 }
You can’t perform that action at this time.
0 commit comments