@@ -9,14 +9,19 @@ use criterion::async_executor::AsyncExecutor;
99#[ cfg( feature = "async" ) ]
1010use std:: future:: Future ;
1111
12- pub struct Bencher {
12+ pub struct Bencher < ' a > {
1313 codspeed : Rc < RefCell < CodSpeed > > ,
1414 uri : String ,
15+ _marker : std:: marker:: PhantomData < & ' a ( ) > ,
1516}
1617
17- impl Bencher {
18+ impl < ' a > Bencher < ' a > {
1819 pub fn new ( codspeed : Rc < RefCell < CodSpeed > > , uri : String ) -> Self {
19- Bencher { codspeed, uri }
20+ Bencher {
21+ codspeed,
22+ uri,
23+ _marker : std:: marker:: PhantomData ,
24+ }
2025 }
2126
2227 #[ inline( never) ]
@@ -120,19 +125,19 @@ impl Bencher {
120125 }
121126
122127 #[ cfg( feature = "async" ) ]
123- pub fn to_async < A : AsyncExecutor > ( & mut self , runner : A ) -> AsyncBencher < A > {
128+ pub fn to_async < ' b , A : AsyncExecutor > ( & ' b mut self , runner : A ) -> AsyncBencher < ' a , ' b , A > {
124129 AsyncBencher { b : self , runner }
125130 }
126131}
127132
128133#[ cfg( feature = "async" ) ]
129- pub struct AsyncBencher < ' b , A : AsyncExecutor > {
130- b : & ' b mut Bencher ,
134+ pub struct AsyncBencher < ' a , ' b , A : AsyncExecutor > {
135+ b : & ' b mut Bencher < ' a > ,
131136 runner : A ,
132137}
133138
134139#[ cfg( feature = "async" ) ]
135- impl < ' b , A : AsyncExecutor > AsyncBencher < ' b , A > {
140+ impl < ' a , ' b , A : AsyncExecutor > AsyncBencher < ' a , ' b , A > {
136141 #[ allow( clippy:: await_holding_refcell_ref) ]
137142 #[ inline( never) ]
138143 pub fn iter < O , R , F > ( & mut self , mut routine : R )
0 commit comments