Fix a segfault caused by moving into an uninitalized pointer

This commit is contained in:
Nadja Reitzenstein 2022-03-11 22:43:34 +01:00
parent f79e73d669
commit 4489f710d8

View File

@ -145,10 +145,9 @@ impl<'a, 'executor: 'a> Executor<'executor> {
// Wrap the future into one that stores the result into `out`.
let future = {
let out = out.as_mut_ptr();
let out: *mut R = out.as_mut_ptr();
async move {
*out = future.await;
out.write(future.await);
}
};