From fdb8da32932c6949a2f1da75f44ec6cec3e14aac Mon Sep 17 00:00:00 2001 From: Avril Date: Tue, 28 Sep 2021 20:00:18 +0100 Subject: [PATCH] Fix unwind in collect_array() incorrectly dropping slice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fortune for transfer's current commit: Future blessing − 末吉 --- src/ext.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ext.rs b/src/ext.rs index b0d5bbf..fbe7e1d 100644 --- a/src/ext.rs +++ b/src/ext.rs @@ -212,13 +212,11 @@ where I: Iterator Err(e) => { // Drop all initialised elements before resuming unwind. unsafe { - std::ptr::drop_in_place(&mut out[..init_to] as *mut [_]); + std::ptr::drop_in_place(&mut out[..init_to] as *mut [MaybeUninit] as *mut [I::Item]); } std::panic::resume_unwind(e) - }, } - } }