We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9266ddd + 91fdfcc commit 090a454Copy full SHA for 090a454
glib/src/main_context_futures.rs
@@ -355,7 +355,10 @@ impl<T: 'static> futures_core::FusedFuture for JoinHandle<T> {
355
}
356
357
358
-unsafe impl<T> Send for JoinHandle<T> {}
+/// Safety: We can't rely on the auto implementation because we are retrieving
359
+/// the result as a `Box<dyn Any + 'static>` from the [`Source`]. We need to
360
+/// rely on type erasure here, so we have to manually assert the Send bound too.
361
+unsafe impl<T: Send> Send for JoinHandle<T> {}
362
363
// rustdoc-stripper-ignore-next
364
/// Variant of [`JoinHandle`] that is returned from [`MainContext::spawn_from_within`].
0 commit comments