Skip to content

Commit a9c0355

Browse files
committed
Pass function for Thread as Send to Thread::imp
1 parent 0c00a7b commit a9c0355

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/std/src/thread/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ impl Builder {
561561
let main = Box::new(main);
562562
// SAFETY: dynamic size and alignment of the Box remain the same. See below for why the
563563
// lifetime change is justified.
564-
let main = unsafe { Box::from_raw(Box::into_raw(main) as *mut (dyn FnOnce() + 'static)) };
564+
let main = unsafe { Box::from_raw(Box::into_raw(main) as *mut (dyn FnOnce() + Send + 'static)) };
565565

566566
Ok(JoinInner {
567567
// SAFETY:
@@ -1544,7 +1544,7 @@ struct Packet<'scope, T> {
15441544
// The type `T` should already always be Send (otherwise the thread could not
15451545
// have been created) and the Packet is Sync because all access to the
15461546
// `UnsafeCell` synchronized (by the `join()` boundary), and `ScopeData` is Sync.
1547-
unsafe impl<'scope, T: Sync> Sync for Packet<'scope, T> {}
1547+
unsafe impl<'scope, T: Send> Sync for Packet<'scope, T> {}
15481548

15491549
impl<'scope, T> Drop for Packet<'scope, T> {
15501550
fn drop(&mut self) {

0 commit comments

Comments
 (0)