@@ -191,7 +191,7 @@ struct CounterWrapper<'a> {
191191}
192192
193193impl < ' a > CounterWrapper < ' a > {
194- fn new ( counter : & Counter ) -> CounterWrapper {
194+ fn new ( counter : & Counter ) -> CounterWrapper < ' _ > {
195195 counter. i . fetch_add ( 1 , Ordering :: Relaxed ) ;
196196 CounterWrapper { counter }
197197 }
@@ -204,7 +204,7 @@ impl<'a> Drop for CounterWrapper<'a> {
204204}
205205
206206impl Counter {
207- fn temp_increment ( & self ) -> Vec < CounterWrapper > {
207+ fn temp_increment ( & self ) -> Vec < CounterWrapper < ' _ > > {
208208 vec ! [ CounterWrapper :: new( self ) , CounterWrapper :: new( self ) ]
209209 }
210210}
@@ -480,7 +480,7 @@ impl StateWithBoxedMutexGuard {
480480 fn new ( ) -> StateWithBoxedMutexGuard {
481481 StateWithBoxedMutexGuard { u : Mutex :: new ( 42 ) }
482482 }
483- fn lock ( & self ) -> Box < MutexGuard < u64 > > {
483+ fn lock ( & self ) -> Box < MutexGuard < ' _ , u64 > > {
484484 Box :: new ( self . u . lock ( ) . unwrap ( ) )
485485 }
486486}
@@ -507,7 +507,7 @@ impl StateStringWithBoxedMutexGuard {
507507 s : Mutex :: new ( "A String" . to_owned ( ) ) ,
508508 }
509509 }
510- fn lock ( & self ) -> Box < MutexGuard < String > > {
510+ fn lock ( & self ) -> Box < MutexGuard < ' _ , String > > {
511511 Box :: new ( self . s . lock ( ) . unwrap ( ) )
512512 }
513513}
@@ -686,11 +686,11 @@ struct Guard<'a, T>(MutexGuard<'a, T>);
686686struct Ref < ' a , T > ( & ' a T ) ;
687687
688688impl < ' a , T > Guard < ' a , T > {
689- fn guard ( & self ) -> & MutexGuard < T > {
689+ fn guard ( & self ) -> & MutexGuard < ' _ , T > {
690690 & self . 0
691691 }
692692
693- fn guard_ref ( & self ) -> Ref < MutexGuard < T > > {
693+ fn guard_ref ( & self ) -> Ref < ' _ , MutexGuard < ' _ , T > > {
694694 Ref ( & self . 0 )
695695 }
696696
0 commit comments