diff options
| author | David Tolnay <dtolnay@gmail.com> | 2024-08-06 10:20:48 -0700 |
|---|---|---|
| committer | David Tolnay <dtolnay@gmail.com> | 2024-08-06 10:20:48 -0700 |
| commit | ba3cb156cb5e6cc9860600ec6dc7713d69e6b17b (patch) | |
| tree | 1ad183e294ce59dbc9315a5d68fea876ea63e5af /library/std/src/thread | |
| parent | 60d146580c10036ce89e019422c6bc2fd9729b65 (diff) | |
| download | rust-ba3cb156cb5e6cc9860600ec6dc7713d69e6b17b.tar.gz rust-ba3cb156cb5e6cc9860600ec6dc7713d69e6b17b.zip | |
Remove unused lifetime parameter from spawn_unchecked
Diffstat (limited to 'library/std/src/thread')
| -rw-r--r-- | library/std/src/thread/mod.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/library/std/src/thread/mod.rs b/library/std/src/thread/mod.rs index 59720f77465..88b31cd78a6 100644 --- a/library/std/src/thread/mod.rs +++ b/library/std/src/thread/mod.rs @@ -434,25 +434,24 @@ impl Builder { /// /// [`io::Result`]: crate::io::Result #[unstable(feature = "thread_spawn_unchecked", issue = "55132")] - pub unsafe fn spawn_unchecked<'a, F, T>(self, f: F) -> io::Result<JoinHandle<T>> + pub unsafe fn spawn_unchecked<F, T>(self, f: F) -> io::Result<JoinHandle<T>> where F: FnOnce() -> T, - F: Send + 'a, - T: Send + 'a, + F: Send, + T: Send, { Ok(JoinHandle(unsafe { self.spawn_unchecked_(f, None) }?)) } - unsafe fn spawn_unchecked_<'a, 'scope, F, T>( + unsafe fn spawn_unchecked_<'scope, F, T>( self, f: F, scope_data: Option<Arc<scoped::ScopeData>>, ) -> io::Result<JoinInner<'scope, T>> where F: FnOnce() -> T, - F: Send + 'a, - T: Send + 'a, - 'scope: 'a, + F: Send, + T: Send, { let Builder { name, stack_size } = self; @@ -532,7 +531,7 @@ impl Builder { // will call `decrement_num_running_threads` and therefore signal that this thread is // done. drop(their_packet); - // Here, the lifetime `'a` and even `'scope` can end. `main` keeps running for a bit + // Here, the lifetime `'scope` can end. `main` keeps running for a bit // after that before returning itself. }; |
