@@ -191,7 +191,7 @@ struct CounterWrapper<'a> {
191
191
}
192
192
193
193
impl < ' a > CounterWrapper < ' a > {
194
- fn new ( counter : & Counter ) -> CounterWrapper {
194
+ fn new ( counter : & Counter ) -> CounterWrapper < ' _ > {
195
195
counter. i . fetch_add ( 1 , Ordering :: Relaxed ) ;
196
196
CounterWrapper { counter }
197
197
}
@@ -204,7 +204,7 @@ impl<'a> Drop for CounterWrapper<'a> {
204
204
}
205
205
206
206
impl Counter {
207
- fn temp_increment ( & self ) -> Vec < CounterWrapper > {
207
+ fn temp_increment ( & self ) -> Vec < CounterWrapper < ' _ > > {
208
208
vec ! [ CounterWrapper :: new( self ) , CounterWrapper :: new( self ) ]
209
209
}
210
210
}
@@ -480,7 +480,7 @@ impl StateWithBoxedMutexGuard {
480
480
fn new ( ) -> StateWithBoxedMutexGuard {
481
481
StateWithBoxedMutexGuard { u : Mutex :: new ( 42 ) }
482
482
}
483
- fn lock ( & self ) -> Box < MutexGuard < u64 > > {
483
+ fn lock ( & self ) -> Box < MutexGuard < ' _ , u64 > > {
484
484
Box :: new ( self . u . lock ( ) . unwrap ( ) )
485
485
}
486
486
}
@@ -507,7 +507,7 @@ impl StateStringWithBoxedMutexGuard {
507
507
s : Mutex :: new ( "A String" . to_owned ( ) ) ,
508
508
}
509
509
}
510
- fn lock ( & self ) -> Box < MutexGuard < String > > {
510
+ fn lock ( & self ) -> Box < MutexGuard < ' _ , String > > {
511
511
Box :: new ( self . s . lock ( ) . unwrap ( ) )
512
512
}
513
513
}
@@ -686,11 +686,11 @@ struct Guard<'a, T>(MutexGuard<'a, T>);
686
686
struct Ref < ' a , T > ( & ' a T ) ;
687
687
688
688
impl < ' a , T > Guard < ' a , T > {
689
- fn guard ( & self ) -> & MutexGuard < T > {
689
+ fn guard ( & self ) -> & MutexGuard < ' _ , T > {
690
690
& self . 0
691
691
}
692
692
693
- fn guard_ref ( & self ) -> Ref < MutexGuard < T > > {
693
+ fn guard_ref ( & self ) -> Ref < ' _ , MutexGuard < ' _ , T > > {
694
694
Ref ( & self . 0 )
695
695
}
696
696
0 commit comments