@@ -292,14 +292,14 @@ pub struct PeekMut<
292
292
}
293
293
294
294
#[ stable( feature = "collection_debug" , since = "1.17.0" ) ]
295
- impl < T : Ord + fmt:: Debug , A : Allocator > fmt:: Debug for PeekMut < ' _ , T , A > {
295
+ impl < ' a , T : Ord + fmt:: Debug , A : Allocator + ' a > fmt:: Debug for PeekMut < ' a , T , A > {
296
296
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
297
297
f. debug_tuple ( "PeekMut" ) . field ( & self . heap . data [ 0 ] ) . finish ( )
298
298
}
299
299
}
300
300
301
301
#[ stable( feature = "binary_heap_peek_mut" , since = "1.12.0" ) ]
302
- impl < T : Ord , A : Allocator > Drop for PeekMut < ' _ , T , A > {
302
+ impl < ' a , T : Ord , A : Allocator + ' a > Drop for PeekMut < ' a , T , A > {
303
303
fn drop ( & mut self ) {
304
304
if self . sift {
305
305
// SAFETY: PeekMut is only instantiated for non-empty heaps.
@@ -309,7 +309,7 @@ impl<T: Ord, A: Allocator> Drop for PeekMut<'_, T, A> {
309
309
}
310
310
311
311
#[ stable( feature = "binary_heap_peek_mut" , since = "1.12.0" ) ]
312
- impl < T : Ord , A : Allocator > Deref for PeekMut < ' _ , T , A > {
312
+ impl < ' a , T : Ord , A : Allocator + ' a > Deref for PeekMut < ' a , T , A > {
313
313
type Target = T ;
314
314
fn deref ( & self ) -> & T {
315
315
debug_assert ! ( !self . heap. is_empty( ) ) ;
@@ -319,7 +319,7 @@ impl<T: Ord, A: Allocator> Deref for PeekMut<'_, T, A> {
319
319
}
320
320
321
321
#[ stable( feature = "binary_heap_peek_mut" , since = "1.12.0" ) ]
322
- impl < T : Ord , A : Allocator > DerefMut for PeekMut < ' _ , T , A > {
322
+ impl < ' a , T : Ord , A : Allocator + ' a > DerefMut for PeekMut < ' a , T , A > {
323
323
fn deref_mut ( & mut self ) -> & mut T {
324
324
debug_assert ! ( !self . heap. is_empty( ) ) ;
325
325
self . sift = true ;
@@ -328,10 +328,10 @@ impl<T: Ord, A: Allocator> DerefMut for PeekMut<'_, T, A> {
328
328
}
329
329
}
330
330
331
- impl < ' a , T : Ord > PeekMut < ' a , T > {
331
+ impl < ' a , T : Ord , A : Allocator + ' a > PeekMut < ' a , T , A > {
332
332
/// Removes the peeked value from the heap and returns it.
333
333
#[ stable( feature = "binary_heap_peek_mut_pop" , since = "1.18.0" ) ]
334
- pub fn pop ( mut this : PeekMut < ' a , T > ) -> T {
334
+ pub fn pop ( mut this : PeekMut < ' a , T , A > ) -> T {
335
335
let value = this. heap . pop ( ) . unwrap ( ) ;
336
336
this. sift = false ;
337
337
value
@@ -1611,7 +1611,7 @@ impl<'a, T: Ord, A: Allocator + 'a> Drop for DrainSorted<'a, T, A> {
1611
1611
}
1612
1612
1613
1613
#[ unstable( feature = "binary_heap_drain_sorted" , issue = "59278" ) ]
1614
- impl < T : Ord , A : Allocator > Iterator for DrainSorted < ' _ , T , A > {
1614
+ impl < ' a , T : Ord , A : Allocator + ' a > Iterator for DrainSorted < ' a , T , A > {
1615
1615
type Item = T ;
1616
1616
1617
1617
#[ inline]
@@ -1627,13 +1627,13 @@ impl<T: Ord, A: Allocator> Iterator for DrainSorted<'_, T, A> {
1627
1627
}
1628
1628
1629
1629
#[ unstable( feature = "binary_heap_drain_sorted" , issue = "59278" ) ]
1630
- impl < T : Ord , A : Allocator > ExactSizeIterator for DrainSorted < ' _ , T , A > { }
1630
+ impl < ' a , T : Ord , A : Allocator + ' a > ExactSizeIterator for DrainSorted < ' a , T , A > { }
1631
1631
1632
1632
#[ unstable( feature = "binary_heap_drain_sorted" , issue = "59278" ) ]
1633
- impl < T : Ord , A : Allocator > FusedIterator for DrainSorted < ' _ , T , A > { }
1633
+ impl < ' a , T : Ord , A : Allocator + ' a > FusedIterator for DrainSorted < ' a , T , A > { }
1634
1634
1635
1635
#[ unstable( feature = "trusted_len" , issue = "37572" ) ]
1636
- unsafe impl < T : Ord , A : Allocator > TrustedLen for DrainSorted < ' _ , T , A > { }
1636
+ unsafe impl < ' a , T : Ord , A : Allocator + ' a > TrustedLen for DrainSorted < ' a , T , A > { }
1637
1637
1638
1638
#[ stable( feature = "binary_heap_extras_15" , since = "1.5.0" ) ]
1639
1639
impl < T : Ord , A : Allocator > From < Vec < T , A > > for BinaryHeap < T , A > {
0 commit comments