mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 14:01:51 +00:00
Remove unused lifetime parameter from spawn_unchecked
This commit is contained in:
parent
60d146580c
commit
ba3cb156cb
@ -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.
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user