Relax the lifetime constraints on T for spawn_scoped

This commit is contained in:
james7132 2024-04-15 21:37:04 -07:00
parent 17dde2400d
commit 890b823345
No known key found for this signature in database
GPG Key ID: BDB0606BDC85825B
1 changed files with 2 additions and 2 deletions

View File

@ -190,7 +190,7 @@ impl StaticExecutor {
///
/// The caller must ensure that the returned task terminates
/// or is cancelled before the end of 'a.
pub unsafe fn spawn_scoped<'a, T: Send + 'static>(
pub unsafe fn spawn_scoped<'a, T: Send + 'a>(
&'static self,
future: impl Future<Output = T> + Send + 'a,
) -> Task<T> {
@ -371,7 +371,7 @@ impl StaticLocalExecutor {
///
/// The caller must ensure that the returned task terminates
/// or is cancelled before the end of 'a.
pub unsafe fn spawn_scoped<'a, T: 'static>(
pub unsafe fn spawn_scoped<'a, T: 'a>(
&'static self,
future: impl Future<Output = T> + 'a,
) -> Task<T> {