Skip to content

Commit

Permalink
Remove unused lifetime parameter from spawn_unchecked
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Aug 6, 2024
1 parent 60d1465 commit ba3cb15
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions library/std/src/thread/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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.
};

Expand Down

0 comments on commit ba3cb15

Please sign in to comment.