task: Better typed RawTask::try_read_output (#7806)

This commit is contained in:
Stepan Koltsov
2025-12-30 16:53:20 +02:00
committed by GitHub
parent a708ad19cb
commit 6d3feb581f
2 changed files with 3 additions and 4 deletions
+1 -2
View File
@@ -339,8 +339,7 @@ impl<T> Future for JoinHandle<T> {
//
// The type of `T` must match the task's output type.
unsafe {
self.raw
.try_read_output(&mut ret as *mut _ as *mut (), cx.waker());
self.raw.try_read_output(&mut ret, cx.waker());
}
if ret.is_ready() {
+2 -2
View File
@@ -281,9 +281,9 @@ impl RawTask {
/// Safety: `dst` must be a `*mut Poll<super::Result<T::Output>>` where `T`
/// is the future stored by the task.
pub(super) unsafe fn try_read_output(self, dst: *mut (), waker: &Waker) {
pub(super) unsafe fn try_read_output<O>(self, dst: *mut Poll<super::Result<O>>, waker: &Waker) {
let vtable = self.header().vtable;
(vtable.try_read_output)(self.ptr, dst, waker);
(vtable.try_read_output)(self.ptr, dst as *mut _, waker);
}
pub(super) fn drop_join_handle_slow(self) {