Fix unwind in collect_array() incorrectly dropping slice

Fortune for transfer's current commit: Future blessing − 末吉
basic
Avril 3 years ago
parent dca0c79c4a
commit fdb8da3293
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -212,13 +212,11 @@ where I: Iterator
Err(e) => { Err(e) => {
// Drop all initialised elements before resuming unwind. // Drop all initialised elements before resuming unwind.
unsafe { unsafe {
std::ptr::drop_in_place(&mut out[..init_to] as *mut [_]); std::ptr::drop_in_place(&mut out[..init_to] as *mut [MaybeUninit<I::Item>] as *mut [I::Item]);
} }
std::panic::resume_unwind(e) std::panic::resume_unwind(e)
}, },
} }
} }
} }

Loading…
Cancel
Save