diff --git a/crates/bevy_tasks/src/single_threaded_task_pool.rs b/crates/bevy_tasks/src/single_threaded_task_pool.rs index 1be0b0da174e31..f3837c4766fae3 100644 --- a/crates/bevy_tasks/src/single_threaded_task_pool.rs +++ b/crates/bevy_tasks/src/single_threaded_task_pool.rs @@ -202,7 +202,7 @@ impl FakeTask { /// For more information, see [`TaskPool::scope`]. #[derive(Debug)] pub struct Scope<'scope, 'env: 'scope, T> { - executor: &'env async_executor::LocalExecutor<'env>, + executor: &'scope async_executor::LocalExecutor<'scope>, // Vector to gather results of all futures spawned during scope run results: &'env RefCell>>>>, @@ -219,7 +219,7 @@ impl<'scope, 'env, T: Send + 'env> Scope<'scope, 'env, T> { /// On the single threaded task pool, it just calls [`Scope::spawn_on_scope`]. /// /// For more information, see [`TaskPool::scope`]. - pub fn spawn + 'env>(&self, f: Fut) { + pub fn spawn + 'scope>(&self, f: Fut) { self.spawn_on_scope(f); } @@ -230,7 +230,7 @@ impl<'scope, 'env, T: Send + 'env> Scope<'scope, 'env, T> { /// On the single threaded task pool, it just calls [`Scope::spawn_on_scope`]. /// /// For more information, see [`TaskPool::scope`]. - pub fn spawn_on_external + 'env>(&self, f: Fut) { + pub fn spawn_on_external + 'scope>(&self, f: Fut) { self.spawn_on_scope(f); } @@ -239,7 +239,7 @@ impl<'scope, 'env, T: Send + 'env> Scope<'scope, 'env, T> { /// returned as a part of [`TaskPool::scope`]'s return value. /// /// For more information, see [`TaskPool::scope`]. - pub fn spawn_on_scope + 'env>(&self, f: Fut) { + pub fn spawn_on_scope + 'scope>(&self, f: Fut) { let result = Rc::new(RefCell::new(None)); self.results.borrow_mut().push(result.clone()); let f = async move {