@@ -213,7 +213,7 @@ impl TaskPool {
213
213
///
214
214
pub fn scope < ' env , F , T > ( & self , f : F ) -> Vec < T >
215
215
where
216
- F : for < ' scope > FnOnce ( & ' env Scope < ' scope , ' env , T > ) ,
216
+ F : for < ' scope > FnOnce ( & ' scope Scope < ' scope , ' env , T > ) ,
217
217
T : Send + ' static ,
218
218
{
219
219
// SAFETY: This safety comment applies to all references transmuted to 'env.
@@ -333,15 +333,15 @@ impl Drop for TaskPool {
333
333
/// For more information, see [`TaskPool::scope`].
334
334
#[ derive( Debug ) ]
335
335
pub struct Scope < ' scope , ' env : ' scope , T > {
336
- executor : & ' env async_executor:: Executor < ' env > ,
337
- task_scope_executor : & ' env async_executor:: Executor < ' env > ,
338
- spawned : & ' env ConcurrentQueue < async_executor:: Task < T > > ,
336
+ executor : & ' scope async_executor:: Executor < ' scope > ,
337
+ task_scope_executor : & ' scope async_executor:: Executor < ' scope > ,
338
+ spawned : & ' scope ConcurrentQueue < async_executor:: Task < T > > ,
339
339
// make `Scope` invariant over 'scope and 'env
340
340
scope : PhantomData < & ' scope mut & ' scope ( ) > ,
341
341
env : PhantomData < & ' env mut & ' env ( ) > ,
342
342
}
343
343
344
- impl < ' scope , ' env , T : Send + ' env > Scope < ' scope , ' env , T > {
344
+ impl < ' scope , ' env , T : Send + ' scope > Scope < ' scope , ' env , T > {
345
345
/// Spawns a scoped future onto the thread pool. The scope *must* outlive
346
346
/// the provided future. The results of the future will be returned as a part of
347
347
/// [`TaskPool::scope`]'s return value.
@@ -350,7 +350,7 @@ impl<'scope, 'env, T: Send + 'env> Scope<'scope, 'env, T> {
350
350
/// instead.
351
351
///
352
352
/// For more information, see [`TaskPool::scope`].
353
- pub fn spawn < Fut : Future < Output = T > + ' env + Send > ( & self , f : Fut ) {
353
+ pub fn spawn < Fut : Future < Output = T > + ' scope + Send > ( & self , f : Fut ) {
354
354
let task = self . executor . spawn ( f) ;
355
355
// ConcurrentQueue only errors when closed or full, but we never
356
356
// close and use an unbouded queue, so it is safe to unwrap
@@ -363,7 +363,7 @@ impl<'scope, 'env, T: Send + 'env> Scope<'scope, 'env, T> {
363
363
/// [`Scope::spawn`] instead, unless the provided future needs to run on the scope's thread.
364
364
///
365
365
/// For more information, see [`TaskPool::scope`].
366
- pub fn spawn_on_scope < Fut : Future < Output = T > + ' env + Send > ( & self , f : Fut ) {
366
+ pub fn spawn_on_scope < Fut : Future < Output = T > + ' scope + Send > ( & self , f : Fut ) {
367
367
let task = self . task_scope_executor . spawn ( f) ;
368
368
// ConcurrentQueue only errors when closed or full, but we never
369
369
// close and use an unbouded queue, so it is safe to unwrap
0 commit comments